Skip to content

watch: complete the run-half (4.2) — affected-test selection + coverage-on-save#1

Merged
rafael5 merged 1 commit into
mainfrom
watch-run-half-complete
May 30, 2026
Merged

watch: complete the run-half (4.2) — affected-test selection + coverage-on-save#1
rafael5 merged 1 commit into
mainfrom
watch-run-half-complete

Conversation

@rafael5

@rafael5 rafael5 commented May 30, 2026

Copy link
Copy Markdown
Contributor

Completes stage 4.2 m watch run-half (compile·test·coverage).

Affected-test selection

m watch --run no longer re-runs every suite on save — it runs only the suites that exercise a changed routine.

  • mtest.ReferencedRoutines extracts a suite's external call targets (LABEL^ROUTINE / ^ROUTINE / $$^ROUTINE) via workspace.References; local bare-label calls excluded.
  • Discover records them on TestSuite.Deps.
  • Affected(suites, changed) selects suites whose own routine changed or whose Deps intersect the changed set.

Coverage-on-save

  • New mcov.ByFile per-file rollup (also de-duplicates coverageCmd's inline rollup — one code path now).
  • m watch --coverage (implies --run) measures the changed routines while driving the affected suites; prints cov: <routine> C/T P%.

Verification

  • gofmt / go vet / golangci-lint clean; go test -race ./... green; internal/mtest 85.1%.
  • Live on m-test-engine (YDB): affected selection — baseline 2/2, edit STR.m1/1 (MATHTST skipped), edit unreferenced routine → no suites affected; coverage — edit MATH.mtests: 1/1 ok + cov: MATH.m 1/2 50.0%.

Tracker flip (4.2 ◐ → ✅) is in the companion docs PR.

🤖 Generated with Claude Code

…ge-on-save

`m watch --run` no longer re-runs every suite on each save: it now runs only
the suites that exercise a changed routine, and `--coverage` reports line
coverage for the changed routines.

Affected-test selection (mtest):
- ReferencedRoutines extracts a suite's external call targets
  (LABEL^ROUTINE / ^ROUTINE / $$^ROUTINE) via workspace.References; local
  bare-label calls are excluded.
- Discover records them on TestSuite.Deps.
- Affected(suites, changed) picks suites whose own routine changed or whose
  Deps intersect the changed set.

Coverage-on-save:
- New mcov.ByFile per-file rollup (also de-duplicates coverageCmd's inline
  rollup — one code path now).
- m watch --coverage (implies --run) measures the changed routines while
  driving the affected suites; prints `cov: <routine> C/T P%`.

Validated live on m-test-engine (YDB); gofmt/vet/golangci-lint clean;
go test -race ./... green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rafael5 rafael5 merged commit 65b6966 into main May 30, 2026
1 check passed
@rafael5 rafael5 deleted the watch-run-half-complete branch May 30, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant