Skip to content

Commit c646bec

Browse files
tedilHoeze
andauthored
ci(repo): fix tox/pytest execution args (#562)
Seems like only top level tests were executed in CI. An alternative would be to remove the default "tests" in the root pyproject.toml tox config from ``` commands = [["pytest", { replace = "posargs", default = ["tests"], extend = true }]] ``` to ``` commands = [["pytest", { replace = "posargs", default = [], extend = true }]] ``` but then that would do pytest auto discovery, which triggers testing _everything_ all the time. --------- Co-authored-by: Florian R. Hölzlwimmer <git.ich@frhoelzlwimmer.de>
1 parent 9060876 commit c646bec

3 files changed

Lines changed: 3 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ jobs:
283283
run: which grz-check && grz-check --version
284284

285285
- name: Test ${{ matrix.python-version }}
286-
run: uv run tox -e ${{ matrix.python-version }}
286+
run: uv run tox -e ${{ matrix.python-version }} -- tests/
287287

288288
test-changed-packages-python:
289289
name: Test Changed Python Packages
@@ -335,4 +335,4 @@ jobs:
335335
run: cd ${{ matrix.package.path }} && uv lock --check
336336

337337
- name: Run tests for ${{ steps.pkg_info.outputs.name }}
338-
run: cd ${{ matrix.package.path }} && uv run tox -e py${{ matrix.python-version }}
338+
run: uv run tox -e py${{ matrix.python-version }} -- ${{ matrix.package.path }}

CONTRIBUTING.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ uv sync --all-packages --all-groups --all-extras
3232
To run integration tests for all packages in this monorepo, run the following from the repository root:
3333

3434
```bash
35-
for d in packages/*; do
36-
if [ -f "$d/pyproject.toml" ]; then
37-
printf '\n\033[1;97;44m RUNNING TESTS: %s \033[0m\n\n' "$d"
38-
(cd "$d" && uv run tox)
39-
fi
40-
done
41-
42-
printf '\n\033[1;97;44m RUNNING GLOBAL TESTS \033[0m\n\n'
4335
uv run tox
4436
```
4537

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ isolated_build = true
196196
runner = "uv-venv-lock-runner"
197197
description = "run unit tests"
198198
dependency_groups = ["test"]
199-
commands = [["pytest", { replace = "posargs", default = ["tests"], extend = true }]]
199+
commands = [["pytest", { replace = "posargs", default = [], extend = true }]]
200200
# isolate Cargo build directories per tox environment, otherwise Cargo caches the compiled Rust extension (and then we end up with mismatches between ABI versions).
201201
setenv = { UV_REINSTALL_PACKAGE = "grz-check", CARGO_TARGET_DIR = "{work_dir}/cargo_target_{env_name}" }
202202

0 commit comments

Comments
 (0)