diff --git a/.github/actions/install-deps-and-generate-openapi-client/action.yml b/.github/actions/install-deps-and-generate-openapi-client/action.yml deleted file mode 100644 index 4d5524320e..0000000000 --- a/.github/actions/install-deps-and-generate-openapi-client/action.yml +++ /dev/null @@ -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' diff --git a/.github/actions/install-python-deps/action.yml b/.github/actions/install-python-deps/action.yml new file mode 100644 index 0000000000..877264aa60 --- /dev/null +++ b/.github/actions/install-python-deps/action.yml @@ -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 diff --git a/.github/actions/run-nightly-provider-chat-test/action.yml b/.github/actions/run-nightly-provider-chat-test/action.yml index 574327af32..bc70d3fb4b 100644 --- a/.github/actions/run-nightly-provider-chat-test/action.yml +++ b/.github/actions/run-nightly-provider-chat-test/action.yml @@ -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 }} diff --git a/.github/workflows/pr-database-tests.yml b/.github/workflows/pr-database-tests.yml index 058e373f54..ed22fe72f1 100644 --- a/.github/workflows/pr-database-tests.yml +++ b/.github/workflows/pr-database-tests.yml @@ -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: diff --git a/.github/workflows/pr-integration-tests.yml b/.github/workflows/pr-integration-tests.yml index 4d1cd9c38e..a53b3aeb90 100644 --- a/.github/workflows/pr-integration-tests.yml +++ b/.github/workflows/pr-integration-tests.yml @@ -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 }} diff --git a/backend/pytest.ini b/backend/pytest.ini index e2f65d66a9..30c2892675 100644 --- a/backend/pytest.ini +++ b/backend/pytest.ini @@ -1,7 +1,6 @@ [pytest] pythonpath = . - generated/onyx_openapi_client asyncio_default_fixture_loop_scope = function markers = slow: marks tests as slow diff --git a/backend/tests/integration/README.md b/backend/tests/integration/README.md index 73d692a577..2163cfd938 100644 --- a/backend/tests/integration/README.md +++ b/backend/tests/integration/README.md @@ -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.