Skip to content

Commit 498eed3

Browse files
committed
Splits long running tuner tests into separate github actions step with pytest marks
1 parent ef61f23 commit 498eed3

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

.github/workflows/lint-test.yaml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
sleep 10 # Wait for services to start
126126
127127
- name: Run integration tests
128-
run: COVERAGE_FILE=.coverage.py${{ matrix.python_version }}.integration uv run coverage run -m pytest ./tests/integration/
128+
run: COVERAGE_FILE=.coverage.py${{ matrix.python_version }}.integration uv run coverage run -m pytest ./tests/integration/ -m "not tuner"
129129
env:
130130
RABBITMQ_URL: amqp://user:password@localhost:5672/
131131

@@ -135,10 +135,52 @@ jobs:
135135
name: coverage-integration-py${{ matrix.python_version }}
136136
include-hidden-files: true
137137
path: .coverage.py${{ matrix.python_version }}.integration*
138+
139+
test-integration-tuner:
140+
name: Tests - integration:tuner
141+
runs-on: ubuntu-latest
142+
timeout-minutes: 5
143+
strategy:
144+
matrix:
145+
python_version: [3.12, 3.13]
146+
steps:
147+
- name: Checkout
148+
uses: actions/checkout@v4
149+
150+
- name: Install python
151+
uses: actions/setup-python@v5
152+
with:
153+
python-version: ${{matrix.python_version}}
154+
155+
- name: Install uv
156+
uses: astral-sh/setup-uv@v4
157+
with:
158+
enable-cache: true
159+
cache-dependency-glob: "uv.lock"
160+
161+
- name: Install project
162+
run: uv sync --group test
163+
164+
- name: Run backing services
165+
run: |
166+
docker compose up rabbitmq -d
167+
sleep 10 # Wait for services to start
168+
169+
- name: Run integration tests
170+
run: COVERAGE_FILE=.coverage.py${{ matrix.python_version }}.integration.tuner uv run coverage run -m pytest ./tests/integration/ -m "tuner"
171+
env:
172+
RABBITMQ_URL: amqp://user:password@localhost:5672/
173+
174+
- name: Upload integration test coverage
175+
uses: actions/upload-artifact@v4
176+
with:
177+
name: coverage-integration-tuner-py${{ matrix.python_version }}
178+
include-hidden-files: true
179+
path: .coverage.py${{ matrix.python_version }}.integration.tuner*
138180

139181
coverage-report:
140182
name: Report coverage
141-
needs: [test-unit, test-integration]
183+
needs: [test-unit, test-integration, test-integration-tuner] # Depends on tests passing
142184
runs-on: ubuntu-latest
143185
strategy:
144186
matrix:

tests/integration/test_tuner.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def config() -> dict:
1616
return msgspec.yaml.decode(f.read())
1717

1818

19+
@pytest.mark.tuner
1920
@pytest.mark.asyncio
2021
@pytest.mark.parametrize("mode", ["min", "max"])
2122
@pytest.mark.parametrize("process_type", ["local", "ray"])
@@ -65,6 +66,7 @@ async def test_tune(config: dict, mode: str, process_type: str, ray_ctx: None) -
6566
assert best_result.metrics["c.in_1"] == 6
6667

6768

69+
@pytest.mark.tuner
6870
@pytest.mark.asyncio
6971
async def test_multi_objective_tune(config: dict, ray_ctx: None) -> None:
7072
"""Tests multi-objective optimisation."""

0 commit comments

Comments
 (0)