feat(app): auto-merge split test suites under one workspace id - #23
Merged
Conversation
The filename convention gains an optional dot-suffix: coverage-<id>[.<suite>].xml and tests-<id>[.<suite>].xml. Multiple same-id artifacts are grouped and combined — coverage is unioned per source line via cobertura.Merge (a line counts as hit if any suite executed it, branch flag is OR'd, branch totals/covered are max), and JUnit test counts are summed. Result: a workspace exercised by unit + integration jobs, or a language-runtime matrix, reports as one row instead of one row per artifact. Backward compatible: single-file usage (coverage-web.xml) is unchanged; merge only kicks in when a .<suite> suffix is present. Dashed ids like shared-widget still resolve as before (artifactID splits at the first dot, not the first dash). Any coverage.yaml workspace entry keyed on the base id applies to every same-id artifact. Documented in README (Filename conventions table + new "Splitting a workspace across test suites" section), docs/README.md, llms.txt, and CHANGELOG. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThe PR wires split-suite aggregation into the CLI, using a double-dash suffix while preserving dotted workspace IDs, and documents the convention.
Confidence Score: 4/5The PR is not yet safe to merge because the dotted-ID fix still breaks existing workspace identity for IDs containing a double dash. Unconditionally treating the first Files Needing Attention: internal/app/app.go Reviews (2): Last reviewed commit: "fix(app): use -- as suite separator so d..." | Re-trigger Greptile |
The previous convention (coverage-<id>.<suite>.xml) used a single dot, which broke backward compatibility for any existing workspace whose id contained a dot: coverage-api.v1.xml was silently truncated to id "api", merging api.v1 and api.v2 into one row with combined coverage and mismatched config/baseline lookups. Nothing in the prior docs forbade dots in ids, so this was a real regression risk. Switch the sentinel to "--" (double dash). Ids with single dashes (shared-widget) or dots (api.v1) now stay distinct — the merge only kicks in on the double-dash marker, which is nearly unheard of in existing ids. Adds TestRunPreservesDottedIDsAsDistinctWorkspaces as a regression guard, feeding two api.v* artifacts through Run and asserting they remain distinct rows with independent config lookup. Reported by Greptile on #23. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment on lines
+482
to
+483
| if sep := strings.Index(rest, "--"); sep >= 0 { | ||
| return rest[:sep] |
There was a problem hiding this comment.
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.
Summary
Follow-up to #22, which added
cobertura.Mergeas a library primitive but didn't wire it into the CLI or document the new behavior. This PR does both.coverage-<id>[.<suite>].xmlandtests-<id>[.<suite>].xml. Multiple artifacts sharing a base id are grouped and combined — coverage is unioned per source line viacobertura.Merge(line hit ⇐ any suite, branch OR'd, branch totals/covered max), and JUnit test counts are summed. A workspace exercised by unit + integration jobs (or a language-runtime matrix) now reports as one row instead of one row per artifact.coverage-web.xmlis unchanged; merge only kicks in when a.<suite>suffix is present. Dashed ids (shared-widget) still resolve as before —artifactIDnow splits at the first dot, not the first dash. Anycoverage.yamlentry keyed on the base id applies to every same-id artifact.docs/README.mdandllms.txtcross-reference it; CHANGELOG under Unreleased.Behavior at a glance
./covcoverage-web.xmlwebrowwebrow (unchanged)coverage-web.unit.xml+coverage-web.integration.xmlweb.unit,web.integration)webrowcoverage-shared-widget.xmlshared-widgetrowshared-widgetrow (unchanged)Test plan
go test ./internal/app/ -run 'TestRunMergesSplitSuites\|TestRunPreservesDashedIDs\|TestRunSplitSuitesShareConfig' -v— three new tests: (1) unit + integration files merge with per-line hits unioned and test counts summed, (2) dashed ids remain untouched, (3) config keyed on base id applies to every same-id file (prefix/strip_prefix included).go test ./...— full suite green.go vet ./...— clean.🤖 Generated with Claude Code