Skip to content

Commit f4e9526

Browse files
authored
fix: address prior PR feedback — CI mutation grep, docs, eval DAG comment (#42)
- CI (PR40): Extract missed count from cargo-mutants summary correctly. Grep was taking first number (total mutants) instead of number before ' missed'; use sed to parse 'N missed' so baseline check is accurate. - README: Add PR workflow note under Contributing. - docs/mutation-testing: Note state/storage_pg not in CI; add local-run table and re-run commands. - eval DAG (PR39): Comment that ExpectationMatching/CommentCount/Benchmark form a linear chain so parallelizable hint has no effect today; keep for consistency. Made-with: Cursor
1 parent 9f2e265 commit f4e9526

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ jobs:
7878
- name: Mutation test (storage_json)
7979
run: |
8080
timeout 900 cargo mutants -f '*storage_json*' 2>&1 | tee mutation.log || true
81-
MISSED=$(grep -E '[0-9]+ missed' mutation.log | tail -1 | grep -oE '[0-9]+' | head -1 || echo "0")
81+
# Extract the missed count (e.g. "14 mutants ... 2 missed, 9 caught" -> 2), not the total
82+
MISSED=$(grep -E '[0-9]+ missed' mutation.log | tail -1 | sed -n 's/.* \([0-9][0-9]*\) missed.*/\1/p' | head -1 || echo "0")
8283
echo "missed=$MISSED" >> "$GITHUB_OUTPUT"
8384
id: mutation
8485
- name: Check mutation baseline

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,8 @@ The summary includes:
10021002

10031003
Contributions are welcome! Please open an issue first to discuss what you would like to change.
10041004

1005+
**PR workflow:** Open a PR → ensure CI is green (version, lint, security, test, mutation, review) → merge when ready. Use a short test plan in the PR description. Small, focused PRs are preferred.
1006+
10051007
### Local Development Checks
10061008

10071009
Enable the repository-managed git hooks after cloning:

docs/mutation-testing.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cargo mutants -f '*storage_pg*'
1515
cargo mutants -f '*cost*'
1616
```
1717

18-
CI runs mutation on `*storage_json*` with a timeout; see [CI job](#ci) below.
18+
CI runs mutation on `*storage_json*` with a timeout; see [CI job](#ci) below. The `*state*` and `*storage_pg*` globs are not run in CI (too many mutants, longer runtime); run locally when auditing those areas.
1919

2020
## Known equivalent / accepted mutants
2121

@@ -37,6 +37,17 @@ After adding targeted tests (refresh_summary, get_event_stats exact aggregates/s
3737

3838
If new mutants appear in these regions, add assertions that would fail on the wrong operator/formula, or add them to this table with a one-line rationale.
3939

40+
### state.rs and storage_pg.rs (local only)
41+
42+
Mutation on `*state*` and `*storage_pg*` is not in CI. Summary from a local run (interrupted; full run is slow):
43+
44+
| Glob | Mutants | Notes |
45+
|---------------|---------|--------|
46+
| `*state*` | ~90 | Many missed: arithmetic in cost/age, `load_reviews_from_disk`, `mark_running` / `complete_review` / `fail_review` / `prune_old_reviews` (no-op or wrong operator), `current_timestamp`, `ReviewEventBuilder`. Killing these would need more unit tests or integration tests that assert side effects. |
47+
| `*storage_pg*`| ~67 | Many missed: `migrate`, `is_empty`, `parse_comment_status`, `save_review` / `get_review` / `list_reviews` / `delete_review` / `save_event` / `list_events` (stubbed return or wrong operator). Would need PostgreSQL-backed tests or contract tests to kill. |
48+
49+
To re-run: `cargo mutants -f '*state*'` and `cargo mutants -f '*storage_pg*'` (allow several minutes each).
50+
4051
## Pre-push vs CI
4152

4253
- **Pre-push** (`.githooks/pre-push`): Runs unit tests, `cargo audit`, web build+test. Does *not* run mutation (too slow for every push).

src/commands/eval/runner/execute/dag.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ fn stage_hints(stage: EvalFixtureStage) -> DagNodeExecutionHints {
188188
side_effects: false,
189189
subgraph: Some("review_pipeline".to_string()),
190190
},
191+
// Linear chain (each depends on previous); parallelizable kept for consistency / future DAG shape.
191192
EvalFixtureStage::ExpectationMatching
192193
| EvalFixtureStage::CommentCountValidation
193194
| EvalFixtureStage::BenchmarkMetrics => DagNodeExecutionHints {

0 commit comments

Comments
 (0)