watch: complete the run-half (4.2) — affected-test selection + coverage-on-save#1
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes stage 4.2
m watchrun-half (compile·test·coverage).Affected-test selection
m watch --runno longer re-runs every suite on save — it runs only the suites that exercise a changed routine.mtest.ReferencedRoutinesextracts a suite's external call targets (LABEL^ROUTINE/^ROUTINE/$$^ROUTINE) viaworkspace.References; local bare-label calls excluded.Discoverrecords them onTestSuite.Deps.Affected(suites, changed)selects suites whose own routine changed or whose Deps intersect the changed set.Coverage-on-save
mcov.ByFileper-file rollup (also de-duplicatescoverageCmd's inline rollup — one code path now).m watch --coverage(implies--run) measures the changed routines while driving the affected suites; printscov: <routine> C/T P%.Verification
go vet/ golangci-lint clean;go test -race ./...green;internal/mtest85.1%.m-test-engine(YDB): affected selection — baseline2/2, editSTR.m→1/1(MATHTST skipped), edit unreferenced routine →no suites affected; coverage — editMATH.m→tests: 1/1 ok+cov: MATH.m 1/2 50.0%.Tracker flip (4.2 ◐ → ✅) is in the companion
docsPR.🤖 Generated with Claude Code