DEVX-136: feat: add fix_pr_title module and update_pr API method
Post-merge / detect-and-configure (push) Successful in 12s
Post-merge / release-and-maintain (push) Successful in 1m0s

This commit was merged in pull request #203.
This commit is contained in:
2026-07-13 23:55:11 +00:00
parent 68f0872134
commit ddfbdec956
32 changed files with 2761 additions and 322 deletions
+16 -7
View File
@@ -339,28 +339,37 @@ devx tools check-test-speed --max-seconds 4 --max-single-seconds 0.5
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).
automatically on every `pytest` invocation and **fails on violations**).
Detected patterns:
Detected patterns (hard errors — exit non-zero):
- **unpatched-subprocess**: `subprocess.run/call/Popen/check_call/check_output`
called in a test function without `@patch`
called in a test function without `@patch` or `with 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
- **heavy-module-import**: `httpx`, `ansible`, etc. imported at module level
- **reload-without-cleanup**: `importlib.reload()` called an odd number of times
Advisory patterns (exit 0 — runtime audit is authoritative):
- **transitive-subprocess**: `CliRunner.invoke(target)` where `target`
transitively calls `subprocess.run` without being patched. Detected via
static call-graph analysis. The runtime subprocess audit catches actual
leaks — if a real subprocess runs without `@patch`, the test fails.
```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 --test-path tests/
devx tools check-test-isolation --categories unpatched-subprocess,transitive-subprocess
devx tools check-test-isolation --max-loop-iterations 50
devx tools check-test-isolation --src-dir src/
```
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
- `--no-test-isolation`disable static analysis and runtime subprocess audit
- `--test-isolation-max-loop N` — max iterations per loop (default: 100)
### `devx tools configure-repo`