Skip to content

feat: run-to-run delta comparison in CI summary#22

Merged
maximn merged 7 commits into
mainfrom
feat/7-2-run-to-run-delta
Apr 2, 2026
Merged

feat: run-to-run delta comparison in CI summary#22
maximn merged 7 commits into
mainfrom
feat/7-2-run-to-run-delta

Conversation

@maximn
Copy link
Copy Markdown
Contributor

@maximn maximn commented Mar 31, 2026

Summary

Adds a "Changes Since Last Run" section to the GitHub Actions CI job summary. When history contains a previous run on the same branch, the summary shows which tests were added, removed, newly failing, or newly passing — plus pass rate and duration deltas.

Changes

  • src/history/comparison.ts (new) — pure computeDelta() function using suite::name composite keys with count-based grouping for correct duplicate test handling
  • src/history/types.ts — added DeltaComparison and DeltaTestInfo types
  • src/output/summary.ts — added renderDeltaSection(), extended SummaryOptions with optional delta field
  • src/index.ts — computes delta after saveHistory(), wrapped in try/catch (errors use core.debug() only)
  • hasChanges reflects both test-level and aggregate metric changes (pass rate, duration)
  • Duplicate test names within the same suite are handled correctly via status-count diffing
  • 28 new tests: 14 unit (comparison logic), 7 unit (rendering), 4 integration (index flow) + 3 updated existing

Test plan

  • 390 tests pass, 0 regressions
  • Delta section appears in CI summary after 2+ runs on same branch
  • Section is omitted on first run (history disabled or single entry)
  • "No changes since last run" shown when tests are identical
  • Pass rate and duration deltas show correct sign formatting
  • Tables cap at 10 entries with collapsible overflow
  • Delta error does not fail the action (debug log only)
  • Duplicate test names within a suite are handled without collapsing
  • Metric-only changes (duration/pass rate) set hasChanges=true

maximn added 7 commits March 30, 2026 21:16
Add run history tracking via GitHub Actions Cache so future
runs can compare against previous results without external
services. Includes HistoryStorage interface, ActionsCacheStorage
implementation, HistoryManager with size guards, and integration
into the main entry point.
v6 only exports ESM which ncc cannot bundle. v4 has a CJS
main entry and the same restoreCache/saveCache API surface.
Adds a "Changes Since Last Run" section to the GitHub Actions CI summary
when history has 2+ entries. Compares tests by suite::name composite key
to detect added, removed, newly failing, and newly passing tests.
Pass rate and duration deltas are always shown for reference.
Comparison now groups tests by composite key and tracks counts per
status, correctly detecting added/removed when duplicates exist.
hasChanges is true when pass rate or duration changed, even if no
test-level changes occurred.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

@maximn maximn merged commit 7423c9c into main Apr 2, 2026
6 checks passed
@maximn maximn deleted the feat/7-2-run-to-run-delta branch April 2, 2026 17:46
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