Skip to content

Commit 1e85c99

Browse files
authored
Merge pull request #145 from Gujiassh/fix/python-smoke-tests
test: replace stale Python checks with smoke tests
2 parents 75d2066 + bfac5b9 commit 1e85c99

2 files changed

Lines changed: 27 additions & 27 deletions

File tree

.github/workflows/test.yml

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [main]
88

99
jobs:
10-
unit-test:
10+
python-smoke:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v6
@@ -18,33 +18,10 @@ jobs:
1818
python-version: "3.11"
1919

2020
- name: Install dependencies
21-
run: pip install anthropic python-dotenv
21+
run: pip install anthropic python-dotenv pytest
2222

23-
- name: Run unit tests
24-
run: python tests/test_unit.py
25-
26-
session-test:
27-
runs-on: ubuntu-latest
28-
strategy:
29-
matrix:
30-
session: [v0, v1, v2, v3, v4, v5, v6, v7, v8a, v8b, v8c, v9]
31-
steps:
32-
- uses: actions/checkout@v6
33-
34-
- name: Set up Python
35-
uses: actions/setup-python@v6
36-
with:
37-
python-version: "3.11"
38-
39-
- name: Install dependencies
40-
run: pip install anthropic python-dotenv
41-
42-
- name: Run ${{ matrix.session }} tests
43-
env:
44-
TEST_API_KEY: ${{ secrets.TEST_API_KEY }}
45-
TEST_BASE_URL: ${{ secrets.TEST_BASE_URL }}
46-
TEST_MODEL: ${{ secrets.TEST_MODEL }}
47-
run: python tests/test_${{ matrix.session }}.py
23+
- name: Run Python smoke tests
24+
run: python -m pytest tests/test_agents_smoke.py -q
4825

4926
web-build:
5027
runs-on: ubuntu-latest

tests/test_agents_smoke.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from __future__ import annotations
2+
3+
from pathlib import Path
4+
import py_compile
5+
6+
import pytest
7+
8+
9+
ROOT = Path(__file__).resolve().parents[1]
10+
AGENTS_DIR = ROOT / "agents"
11+
AGENT_FILES = sorted(
12+
path for path in AGENTS_DIR.glob("*.py") if path.name != "__init__.py"
13+
)
14+
AGENT_IDS = [path.name for path in AGENT_FILES]
15+
16+
17+
@pytest.mark.parametrize("agent_path", AGENT_FILES, ids=AGENT_IDS)
18+
def test_agent_scripts_compile(agent_path: Path) -> None:
19+
_ = py_compile.compile(str(agent_path), doraise=True)
20+
21+
22+
def test_agent_scripts_exist() -> None:
23+
assert AGENT_FILES, "expected at least one agent script"

0 commit comments

Comments
 (0)