Skip to content

Commit 804b723

Browse files
committed
ci: run tests
1 parent 5ba7936 commit 804b723

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

.github/workflows/run-test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: run-test
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
paths:
7+
- ".github/workflows/run-test.yml"
8+
- "src/clawbench/**"
9+
- "tests/**"
10+
- "pyproject.toml"
11+
- "uv.lock"
12+
push:
13+
branches: [ main ]
14+
paths:
15+
- ".github/workflows/run-test.yml"
16+
- "src/clawbench/**"
17+
- "tests/**"
18+
- "pyproject.toml"
19+
- "uv.lock"
20+
workflow_dispatch:
21+
22+
jobs:
23+
run-test:
24+
name: pytest (${{ matrix.os }})
25+
runs-on: ${{ matrix.os }}
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
os:
30+
- ubuntu-latest
31+
- macos-latest
32+
- windows-latest
33+
34+
steps:
35+
- uses: actions/checkout@v6
36+
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v8.1.0
39+
40+
- name: Set up Python
41+
uses: actions/setup-python@v6
42+
with:
43+
python-version: "3.11"
44+
45+
- name: Run host-side pytest suite
46+
run: uv run --frozen pytest

tests/test_cli_entrypoints.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import subprocess
66
import sys
77
import textwrap
8+
import os
89
from pathlib import Path
910

1011
import pytest
@@ -40,10 +41,13 @@ def test_module_help_does_not_require_container_runtime(module: str) -> None:
4041
runpy.run_module(module, run_name="__main__")
4142
"""
4243
)
44+
env = os.environ.copy()
45+
env["PYTHONPATH"] = str(SRC_ROOT)
46+
4347
result = subprocess.run(
4448
[sys.executable, "-c", code, module],
4549
capture_output=True,
46-
env={"PYTHONPATH": str(SRC_ROOT)},
50+
env=env,
4751
text=True,
4852
timeout=30,
4953
)

0 commit comments

Comments
 (0)