Skip to content

Commit fb2be21

Browse files
committed
ci(python-tests): separate job between unit-integration tests
1 parent 6dbe54b commit fb2be21

File tree

1 file changed

+45
-3
lines changed

1 file changed

+45
-3
lines changed

.github/workflows/python-tests.yaml

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# :: Use nektos/act to run this locally
22
# :: Example:
33
# :: `act push -j python-tests --matrix python-version:3.10 --container-architecture linux/amd64`
4+
#
5+
# This workflow runs two separate test suites:
6+
# 1. Unit Tests (python-tests job):
7+
# - Runs across Python 3.9 to 3.13
8+
# - Located in tests/unit directory
9+
# - Coverage report uploaded to Codecov for Python 3.11 only
10+
#
11+
# 2. Integration Tests (integration-tests job):
12+
# - Runs only on Python 3.13
13+
# - Located in tests/integration directory
14+
# - Longer timeout (15 min vs 10 min for unit tests)
15+
# - Separate cache for dependencies
416
name: Python Tests
517
on:
618
workflow_dispatch: {}
@@ -23,7 +35,7 @@ on:
2335
- 'tests/**/*.ipynb'
2436

2537
jobs:
26-
python-tests:
38+
unit-tests:
2739
runs-on: ubuntu-latest
2840
env:
2941
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
@@ -49,10 +61,10 @@ jobs:
4961
run: |
5062
uv sync --group test --group dev
5163
52-
- name: Run tests with coverage
64+
- name: Run unit tests with coverage
5365
timeout-minutes: 10
5466
run: |
55-
uv run -m pytest tests/ -v --cov=agentops --cov-report=xml
67+
uv run -m pytest tests/unit -v --cov=agentops --cov-report=xml
5668
env:
5769
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
5870
AGENTOPS_API_KEY: ${{ secrets.AGENTOPS_API_KEY }}
@@ -68,3 +80,33 @@ jobs:
6880
flags: unittests
6981
name: codecov-umbrella
7082
fail_ci_if_error: true # Should we?
83+
84+
integration-tests:
85+
runs-on: ubuntu-latest
86+
env:
87+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
88+
89+
steps:
90+
- uses: actions/checkout@v4
91+
92+
- name: Setup UV
93+
uses: astral-sh/setup-uv@v5
94+
continue-on-error: true
95+
with:
96+
python-version: "3.13"
97+
enable-cache: true
98+
cache-suffix: uv-3.13-integration
99+
cache-dependency-glob: "**/pyproject.toml"
100+
101+
- name: Install dependencies
102+
run: |
103+
uv sync --group test --group dev
104+
105+
- name: Run integration tests
106+
timeout-minutes: 15
107+
run: |
108+
uv run -m pytest tests/integration -v --cov=agentops --cov-report=xml
109+
env:
110+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
111+
AGENTOPS_API_KEY: ${{ secrets.AGENTOPS_API_KEY }}
112+
PYTHONUNBUFFERED: "1"

0 commit comments

Comments
 (0)