Private
Public Access
feat(directives): add 15 engagement-specific directives + tags.toml entries
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# adapt_test_not_skip_test
|
||||
|
||||
## v1
|
||||
|
||||
**Why this iteration:** New rule, no prior source. Companion to `adapt_test_mocks_to_production_api_change` but scoped to the test itself (not the mock). Reinforces `no_skip_markers_as_avoidance` for the API-change case specifically.
|
||||
**Source:** new rule
|
||||
|
||||
---
|
||||
**Lifted:** 2026-07-05
|
||||
@@ -0,0 +1,30 @@
|
||||
# When a test fails due to a production API change, adapt the test to the new contract — never skip it
|
||||
|
||||
## What it says
|
||||
|
||||
When a test fails because production code changed its public API (function signature, return shape, callable-vs-value), the agent MUST adapt the test to the new contract. The agent MUST NOT add `@pytest.mark.skip` to make the test "pass." Skipping hides the regression; adapting fixes it.
|
||||
|
||||
## Why
|
||||
|
||||
A skipped test is a test that does not run. It provides zero coverage. The production API changed, the test is the only thing that would catch a consumer of the old API, and skipping it means the consumer breakage ships unnoticed. Adapting the test to the new contract keeps the coverage live.
|
||||
|
||||
## The pattern
|
||||
|
||||
```python
|
||||
# WRONG: skip the test
|
||||
@pytest.mark.skip(reason="API changed")
|
||||
def test_old_behavior():
|
||||
...
|
||||
|
||||
# RIGHT: adapt to the new contract
|
||||
def test_new_behavior():
|
||||
# Old: result = C_LBL (value)
|
||||
# New: result = C_LBL() (callable)
|
||||
result = C_LBL()
|
||||
assert isinstance(result, ImVec4)
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- `conductor/directives/adapt_test_mocks_to_production_api_change` — the broader rule for adapting test mocks
|
||||
- `conductor/directives/no_skip_markers_as_avoidance` — skip markers are documentation, not avoidance
|
||||
Reference in New Issue
Block a user