|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +set -e |
| 4 | + |
| 5 | +cd "$(dirname "$0")/.." |
| 6 | + |
| 7 | +echo "==> Detecting breaking changes" |
| 8 | + |
| 9 | +TEST_PATHS=( |
| 10 | + tests/api-resources/completions.test.ts |
| 11 | + tests/api-resources/chat/chat.test.ts |
| 12 | + tests/api-resources/chat/completions/completions.test.ts |
| 13 | + tests/api-resources/chat/completions/messages.test.ts |
| 14 | + tests/api-resources/embeddings.test.ts |
| 15 | + tests/api-resources/files.test.ts |
| 16 | + tests/api-resources/images.test.ts |
| 17 | + tests/api-resources/audio/audio.test.ts |
| 18 | + tests/api-resources/audio/transcriptions.test.ts |
| 19 | + tests/api-resources/audio/translations.test.ts |
| 20 | + tests/api-resources/audio/speech.test.ts |
| 21 | + tests/api-resources/moderations.test.ts |
| 22 | + tests/api-resources/models.test.ts |
| 23 | + tests/api-resources/fine-tuning/fine-tuning.test.ts |
| 24 | + tests/api-resources/fine-tuning/jobs/jobs.test.ts |
| 25 | + tests/api-resources/fine-tuning/jobs/checkpoints.test.ts |
| 26 | + tests/api-resources/fine-tuning/checkpoints/checkpoints.test.ts |
| 27 | + tests/api-resources/fine-tuning/checkpoints/permissions.test.ts |
| 28 | + tests/api-resources/fine-tuning/alpha/alpha.test.ts |
| 29 | + tests/api-resources/fine-tuning/alpha/graders.test.ts |
| 30 | + tests/api-resources/vector-stores/vector-stores.test.ts |
| 31 | + tests/api-resources/vector-stores/files.test.ts |
| 32 | + tests/api-resources/vector-stores/file-batches.test.ts |
| 33 | + tests/api-resources/beta/beta.test.ts |
| 34 | + tests/api-resources/beta/realtime/realtime.test.ts |
| 35 | + tests/api-resources/beta/realtime/sessions.test.ts |
| 36 | + tests/api-resources/beta/realtime/transcription-sessions.test.ts |
| 37 | + tests/api-resources/beta/assistants.test.ts |
| 38 | + tests/api-resources/beta/threads/threads.test.ts |
| 39 | + tests/api-resources/beta/threads/runs/runs.test.ts |
| 40 | + tests/api-resources/beta/threads/runs/steps.test.ts |
| 41 | + tests/api-resources/beta/threads/messages.test.ts |
| 42 | + tests/api-resources/batches.test.ts |
| 43 | + tests/api-resources/uploads/uploads.test.ts |
| 44 | + tests/api-resources/uploads/parts.test.ts |
| 45 | + tests/api-resources/responses/responses.test.ts |
| 46 | + tests/api-resources/responses/input-items.test.ts |
| 47 | + tests/api-resources/evals/evals.test.ts |
| 48 | + tests/api-resources/evals/runs/runs.test.ts |
| 49 | + tests/api-resources/evals/runs/output-items.test.ts |
| 50 | + tests/api-resources/containers/containers.test.ts |
| 51 | + tests/api-resources/containers/files/files.test.ts |
| 52 | + tests/api-resources/containers/files/content.test.ts |
| 53 | + tests/index.test.ts |
| 54 | +) |
| 55 | + |
| 56 | +for PATHSPEC in "${TEST_PATHS[@]}"; do |
| 57 | + # Try to check out previous versions of the test files |
| 58 | + # with the current SDK. |
| 59 | + git checkout "$1" -- "${PATHSPEC}" 2>/dev/null || true |
| 60 | +done |
| 61 | + |
| 62 | +# Instead of running the tests, use the linter to check if an |
| 63 | +# older test is no longer compatible with the latest SDK. |
| 64 | +./scripts/lint |
0 commit comments