Skip to content

test: add compareRuns unit tests#92

Open
veksen wants to merge 1 commit intomainfrom
veksen/test-lastseenhashes
Open

test: add compareRuns unit tests#92
veksen wants to merge 1 commit intomainfrom
veksen/test-lastseenhashes

Conversation

@veksen
Copy link
Member

@veksen veksen commented Mar 20, 2026

Summary

  • Adds unit tests for compareRuns covering new query detection, regression/improvement thresholds, acknowledged regressions, minimumCost filtering, disappeared queries, and a mixed scenario
  • Validates the analyzer correctly handles different previousRun states, which is the mechanism affected by the API-side lastSeenQueryHashes / comparisonBranch fix

Test plan

  • npx vitest run src/reporters/ — 27 tests pass (10 new + 17 existing)
  • tsc --noEmit clean

🤖 Generated with Claude Code

Covers the behavior the analyzer relies on when lastSeenQueryHashes
changes on the API side: empty previousRun (all new), partial match
(only unseen are new), cost regressions, threshold filtering,
acknowledged regressions, minimumCost, and disappeared queries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Query Doctor Analysis

View full run details

32 queries analyzed | 1 new query

2 pre-existing issues

Using assumed statistics (10000 rows/table). For better results, sync production stats.

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