DEVX-129: feat: test isolation pytest plugin, shift-left quality gates, dep upgrades
Post-merge / detect-and-configure (push) Successful in 11s
Post-merge / release-and-maintain (push) Failing after 27s

This commit was merged in pull request #195.
This commit is contained in:
2026-07-13 00:57:28 +00:00
parent b923e47d81
commit 77c2f7e043
15 changed files with 1711 additions and 129 deletions
+29
View File
@@ -334,6 +334,35 @@ devx tools check-test-speed --max-seconds 10
devx tools check-test-speed --max-seconds 4 --max-single-seconds 0.5
```
### `devx tools check-test-isolation`
Statically analyze test files for un-hermetic patterns that cause slow
or flaky tests. Also available as a **pytest plugin** (auto-discovered
via the `pytest11` entry point when devx is installed — runs
automatically on every `pytest` invocation).
Detected patterns:
- **unpatched-subprocess**: `subprocess.run/call/Popen/check_call/check_output`
called in a test function without `@patch`
- **unpatched-sleep**: `time.sleep` called without `@patch`
- **unpatched-helper**: known subprocess-spawning helpers (`update_doc_versions`,
`run_cmd`, `run_tests`) called without `@patch` or patching their internal deps
- **excessive-iterations**: `for _ in range(N)` where N > 100
```bash
devx tools check-test-isolation
devx tools check-test-isolation --test-path tests/ --strict
devx tools check-test-isolation --categories unpatched-subprocess,unpatched-sleep
devx tools check-test-isolation --max-loop-iterations 50
```
Pytest plugin options (automatic when devx is installed):
- `--strict-test-isolation` — fail the test run on violations
- `--no-test-isolation` — disable analysis for this run
- `--test-isolation-max-loop N` — max iterations per loop (default: 100)
### `devx tools configure-repo`
Configure repository: branch protection and labels via the Gitea REST API.