mirror of
https://github.com/onyx-dot-app/onyx.git
synced 2026-10-19 01:50:51 -05:00
chore(ci): stop generating the OpenAPI client for tests (#14125)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
48a6245440
commit
54e417c882
7 files changed
+32
-52
No files matched your search
@@ -1,21 +0,0 @@
|
||||
name: "Install Python deps and generate OpenAPI client"
|
||||
description: "Syncs Python deps inside the devcontainer (one venv shared by openapi gen and pytest) and runs `ods openapi all` to produce the schema + Python client into the bind-mounted workspace."
|
||||
inputs:
|
||||
devcontainer-image:
|
||||
description: "Fully qualified devcontainer image reference (registry:tag)"
|
||||
required: true
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Sync deps and generate OpenAPI client in devcontainer
|
||||
shell: bash
|
||||
env:
|
||||
DEVCONTAINER_IMAGE: ${{ inputs.devcontainer-image }}
|
||||
WORKSPACE: ${{ github.workspace }}
|
||||
run: |
|
||||
docker run --rm \
|
||||
-v "${WORKSPACE}:/workspace" \
|
||||
-w /workspace \
|
||||
-e LICENSE_ENFORCEMENT_ENABLED=false \
|
||||
"${DEVCONTAINER_IMAGE}" \
|
||||
bash -c 'uv sync --frozen --no-group model_server && uv run --no-sync ods openapi all'
|
||||
@@ -0,0 +1,20 @@
|
||||
name: "Install Python deps"
|
||||
description: "Syncs Python deps inside the devcontainer into the bind-mounted workspace, so later `uv run --no-sync` steps share one venv."
|
||||
inputs:
|
||||
devcontainer-image:
|
||||
description: "Fully qualified devcontainer image reference (registry:tag)"
|
||||
required: true
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Sync deps in devcontainer
|
||||
shell: bash
|
||||
env:
|
||||
DEVCONTAINER_IMAGE: ${{ inputs.devcontainer-image }}
|
||||
WORKSPACE: ${{ github.workspace }}
|
||||
run: |
|
||||
docker run --rm \
|
||||
-v "${WORKSPACE}:/workspace" \
|
||||
-w /workspace \
|
||||
"${DEVCONTAINER_IMAGE}" \
|
||||
uv sync --frozen --no-group model_server
|
||||
@@ -85,8 +85,8 @@ runs:
|
||||
minio \
|
||||
inference_model_server
|
||||
|
||||
- name: Install Python deps and generate OpenAPI client
|
||||
uses: ./.github/actions/install-deps-and-generate-openapi-client
|
||||
- name: Install Python deps
|
||||
uses: ./.github/actions/install-python-deps
|
||||
with:
|
||||
devcontainer-image: ${{ inputs.runs-on-ecr-cache }}:nightly-llm-it-devcontainer-${{ inputs.run-id }}
|
||||
|
||||
|
||||
@@ -70,15 +70,6 @@ jobs:
|
||||
backend/requirements/default.txt
|
||||
backend/requirements/dev.txt
|
||||
|
||||
- name: Generate OpenAPI schema and Python client
|
||||
shell: bash
|
||||
# OpenAPI client codegen does not handle some EE-only schema shapes;
|
||||
# disable enforcement so the MIT route set is exported.
|
||||
env:
|
||||
LICENSE_ENFORCEMENT_ENABLED: "false"
|
||||
run: |
|
||||
ods openapi all
|
||||
|
||||
- name: Log in to ECR pull-through cache
|
||||
uses: ./.github/actions/login-ecr-pullthrough-cache
|
||||
with:
|
||||
|
||||
@@ -82,7 +82,7 @@ jobs:
|
||||
- 'uv.lock'
|
||||
- '.github/workflows/pr-integration-tests.yml'
|
||||
- '.github/actions/setup-test-license/**'
|
||||
- '.github/actions/install-deps-and-generate-openapi-client/**'
|
||||
- '.github/actions/install-python-deps/**'
|
||||
- '.github/actions/login-ecr-pullthrough-cache/**'
|
||||
gateway:
|
||||
- 'backend/onyx/server/gateway/**'
|
||||
@@ -355,8 +355,8 @@ jobs:
|
||||
cd cli
|
||||
GOARCH=arm64 GOOS=linux go build -o ${{ github.workspace }}/onyx-cli-test .
|
||||
|
||||
- name: Install Python deps and generate OpenAPI client
|
||||
uses: ./.github/actions/install-deps-and-generate-openapi-client
|
||||
- name: Install Python deps
|
||||
uses: ./.github/actions/install-python-deps
|
||||
with:
|
||||
devcontainer-image: ${{ env.RUNS_ON_ECR_CACHE }}:integration-test-devcontainer-${{ github.run_id }}
|
||||
|
||||
@@ -513,8 +513,8 @@ jobs:
|
||||
relational_db
|
||||
id: start_docker_onyx_lite
|
||||
|
||||
- name: Install Python deps and generate OpenAPI client
|
||||
uses: ./.github/actions/install-deps-and-generate-openapi-client
|
||||
- name: Install Python deps
|
||||
uses: ./.github/actions/install-python-deps
|
||||
with:
|
||||
devcontainer-image: ${{ env.RUNS_ON_ECR_CACHE }}:integration-test-devcontainer-${{ github.run_id }}
|
||||
|
||||
@@ -618,8 +618,8 @@ jobs:
|
||||
inference_model_server
|
||||
id: start_docker_multi_tenant
|
||||
|
||||
- name: Install Python deps and generate OpenAPI client
|
||||
uses: ./.github/actions/install-deps-and-generate-openapi-client
|
||||
- name: Install Python deps
|
||||
uses: ./.github/actions/install-python-deps
|
||||
with:
|
||||
devcontainer-image: ${{ env.RUNS_ON_ECR_CACHE }}:integration-test-devcontainer-${{ github.run_id }}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[pytest]
|
||||
pythonpath =
|
||||
.
|
||||
generated/onyx_openapi_client
|
||||
asyncio_default_fixture_loop_scope = function
|
||||
markers =
|
||||
slow: marks tests as slow
|
||||
|
||||
@@ -18,19 +18,10 @@ exposed cleanly through public APIs; direct task/stub checks belong in
|
||||
`tests/external_dependency_unit/craft/`.
|
||||
|
||||
## Instructions for Running Integration Tests Locally
|
||||
0. Generate dependencies
|
||||
First install openap-generator
|
||||
```sh
|
||||
brew install openapi-generator
|
||||
```
|
||||
|
||||
Then, using the VSCode/Cursor debugger, run the `Onyx OpenAPI Schema Generator` task (see `CONTRIBUTING_VSCODE.md` for `launch.json` setup instructions).
|
||||
The task automatically generates the Python client needed for integration tests.
|
||||
|
||||
If the client generation fails, try running this command manually:
|
||||
```sh
|
||||
openapi-generator generate -i backend/generated/openapi.json -g python -o backend/generated/onyx_openapi_client --package-name onyx_openapi_client --skip-validate-spec --openapi-normalizer "SIMPLIFY_ONEOF_ANYOF=true,SET_OAS3_NULLABLE=true"
|
||||
```
|
||||
The tests call the API through the manager classes in `common_utils/managers`, so
|
||||
the generated OpenAPI client is not needed. Use `ods openapi all` only if you want
|
||||
the schema or client for other work.
|
||||
|
||||
1. Launch onyx (using Docker or running with a debugger), ensuring the API server is running on port 8080.
|
||||
- If you'd like to set environment variables, you can do so by creating a `.env` file in the onyx/backend/tests/integration/ directory.
|
||||
|
||||
Reference in new issue
Block a user