fix(ci): install pytest when pyproject.toml is missing
CI / lint (push) Successful in 7s
CI / lint (pull_request) Successful in 7s
CI / test (push) Successful in 4s
CI / test (pull_request) Successful in 4s
CI / notify-on-failure (push) Successful in 2s
CI / notify-on-failure (pull_request) Successful in 1s
CI / lint (push) Successful in 7s
CI / lint (pull_request) Successful in 7s
CI / test (push) Successful in 4s
CI / test (pull_request) Successful in 4s
CI / notify-on-failure (push) Successful in 2s
CI / notify-on-failure (pull_request) Successful in 1s
Root cause: ci.yml test job creates .venv but skips dev install when pyproject.toml is absent, leaving pytest uninstalled. Then .venv/bin/pytest fails with 'No such file or directory'. Fix: Install pytest directly when no pyproject.toml, and use /tmp path to avoid workspace pollution.
This commit is contained in:
@@ -47,17 +47,17 @@ jobs:
|
||||
|
||||
- name: Setup Python
|
||||
run: |
|
||||
python3 -m venv .venv
|
||||
python3 -m venv /tmp/ci-venv-test
|
||||
if [ -f pyproject.toml ]; then
|
||||
.venv/bin/pip install --quiet -e ".[dev]"
|
||||
/tmp/ci-venv-test/bin/pip install --quiet -e ".[dev]"
|
||||
else
|
||||
echo "No pyproject.toml, skipping dev install"
|
||||
/tmp/ci-venv-test/bin/pip install --quiet pytest
|
||||
fi
|
||||
|
||||
- name: Run tests (exclude E2E)
|
||||
run: |
|
||||
if [ -d tests ]; then
|
||||
.venv/bin/pytest tests/ -m "not e2e" -x -q
|
||||
/tmp/ci-venv-test/bin/pytest tests/ -m "not e2e" -x -q
|
||||
else
|
||||
echo "No tests/ directory, skipping tests"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user