From 1ec0d33b3de03eb1526fe5e32bab4233f0bc675a Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Wed, 28 May 2025 10:08:20 +0200 Subject: [PATCH 1/2] GitHub action to run integration tests --- .github/workflows/integration_tests.yaml | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/integration_tests.yaml diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml new file mode 100644 index 00000000..839054d6 --- /dev/null +++ b/.github/workflows/integration_tests.yaml @@ -0,0 +1,31 @@ +name: Integration tests + +on: + - push + - pull_request + +jobs: + integration_tests: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + strategy: + matrix: + python-version: ["3.11", "3.12", "3.13"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Python version + run: python --version + - name: PDM installation + run: pip install --user pdm + - name: Install dependencies + run: pdm install + - name: Install devel dependencies + run: pdm install --dev + - name: Run integration tests + run: pdm run python -m pytest -m 'not redis' tests/integration --cov=ols --cov=runner --cov-report term-missing From dd57d457a88b9496f00a23f6ab50efebbe100487 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Wed, 28 May 2025 10:13:43 +0200 Subject: [PATCH 2/2] Updated existing integration tests --- .github/workflows/integration_tests.yaml | 2 +- Makefile | 2 +- tests/configuration/lightspeed-stack.yaml | 7 +++++++ tests/integration/test_configuration.py | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml index 839054d6..feac7892 100644 --- a/.github/workflows/integration_tests.yaml +++ b/.github/workflows/integration_tests.yaml @@ -28,4 +28,4 @@ jobs: - name: Install devel dependencies run: pdm install --dev - name: Run integration tests - run: pdm run python -m pytest -m 'not redis' tests/integration --cov=ols --cov=runner --cov-report term-missing + run: make test-integration diff --git a/Makefile b/Makefile index 65fe166e..8ca860f1 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ test-unit: ## Run the unit tests test-integration: ## Run integration tests tests @echo "Running integration tests..." @echo "Reports will be written to ${ARTIFACT_DIR}" - COVERAGE_FILE="${ARTIFACT_DIR}/.coverage.integration" pdm run pytest tests/integration --cov=src --cov-report term-missing --cov-report "json:${ARTIFACT_DIR}/coverage_integration.json" --junit-xml="${ARTIFACT_DIR}/junit_integration.xml" --cov-fail-under=60 + COVERAGE_FILE="${ARTIFACT_DIR}/.coverage.integration" pdm run pytest tests/integration --cov=src --cov-report term-missing --cov-report "json:${ARTIFACT_DIR}/coverage_integration.json" --junit-xml="${ARTIFACT_DIR}/junit_integration.xml" --cov-fail-under=10 check-types: ## Checks type hints in sources MYPYPATH=src pdm run mypy --namespace-packages --explicit-package-bases --strict --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs src diff --git a/tests/configuration/lightspeed-stack.yaml b/tests/configuration/lightspeed-stack.yaml index ddbb8d1c..ea0729c4 100644 --- a/tests/configuration/lightspeed-stack.yaml +++ b/tests/configuration/lightspeed-stack.yaml @@ -1,4 +1,11 @@ name: foo bar baz +service: + host: localhost + port: 8080 + auth_enabled: false + workers: 1 + color_log: true + access_log: true llama_stack: # Uses a remote llama-stack service # The instance would have already been started with a llama-stack-run.yaml file diff --git a/tests/integration/test_configuration.py b/tests/integration/test_configuration.py index 0d2fbc91..05e40b1e 100644 --- a/tests/integration/test_configuration.py +++ b/tests/integration/test_configuration.py @@ -1,7 +1,7 @@ """Integration tests for configuration loading and handling.""" import pytest -from src.configuration import configuration +from configuration import configuration @pytest.fixture