Skip to content

feat(app): auto-merge split test suites under one workspace id - #23

Merged
cameronnewman merged 2 commits into
mainfrom
feat/auto-merge-split-suites
Aug 25, 2026
Merged

feat(app): auto-merge split test suites under one workspace id#23
cameronnewman merged 2 commits into
mainfrom
feat/auto-merge-split-suites

Conversation

@cameronnewman

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #22, which added cobertura.Merge as a library primitive but didn't wire it into the CLI or document the new behavior. This PR does both.

  • Filename convention gains an optional dot-suffix: coverage-<id>[.<suite>].xml and tests-<id>[.<suite>].xml. Multiple artifacts sharing a base id are grouped and combined — coverage is unioned per source line via cobertura.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.
  • Backward compatible: single-file usage like coverage-web.xml is unchanged; merge only kicks in when a .<suite> suffix is present. Dashed ids (shared-widget) still resolve as before — artifactID now splits at the first dot, not the first dash. Any coverage.yaml entry keyed on the base id applies to every same-id artifact.
  • Docs: README gains a new "Splitting a workspace across test suites" section + updated filename-conventions table; docs/README.md and llms.txt cross-reference it; CHANGELOG under Unreleased.

Behavior at a glance

Files in ./cov Result today Result after this PR
coverage-web.xml one web row one web row (unchanged)
coverage-web.unit.xml + coverage-web.integration.xml two rows (web.unit, web.integration) one merged web row
coverage-shared-widget.xml one shared-widget row one shared-widget row (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.
  • Reviewer sanity check: convention choice (dot as suite separator) — happy with this, or prefer double-dash / config-driven grouping?

🤖 Generated with Claude Code

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-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown

Greptile Summary

The PR wires split-suite aggregation into the CLI, using a double-dash suffix while preserving dotted workspace IDs, and documents the convention.

  • Groups same-base Cobertura reports and merges their coverage.
  • Sums matching JUnit test counts into one workspace row.
  • Adds regression tests and updates user-facing documentation.

Confidence Score: 4/5

The 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 -- as a suite separator causes existing IDs with that sequence to lose configuration and baseline matching and can merge distinct workspaces into one report row.

Files Needing Attention: internal/app/app.go

Fix all with Greploop Fix All in Claude Code

Reviews (2): Last reviewed commit: "fix(app): use -- as suite separator so d..." | Re-trigger Greptile

Comment thread internal/app/app.go Outdated
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 thread internal/app/app.go
Comment on lines +482 to +483
if sep := strings.Index(rest, "--"); sep >= 0 {
return rest[:sep]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Double-dash IDs still collapse

When an existing workspace ID contains --, artifactID discards that sequence and everything after it. An ID such as foo--bar therefore becomes foo, so sibling IDs can merge into one row while configuration and baseline entries keyed by the original IDs stop matching.

Fix in Claude Code

@cameronnewman
cameronnewman merged commit 5f759be into main Aug 25, 2026
7 checks passed
@cameronnewman
cameronnewman deleted the feat/auto-merge-split-suites branch August 25, 2026 04:52
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