[claude] Add unit tests for scorecard_service.py (#1139) #1320

Merged
Timmy merged 1 commits from claude/issue-1139 into main 2026-03-24 02:12:47 +00:00

1 Commits

Author SHA1 Message Date
Alexander Whitestone
48cf182c6e test: add unit tests for scorecard_service.py edge cases
Some checks failed
Tests / lint (pull_request) Failing after 35s
Tests / test (pull_request) Has been skipped
Adds tests/dashboard/test_scorecard_service.py with 31 unit tests
covering gaps not addressed in test_scorecards.py:
- _aggregate_metrics: test.execution events, PR-closed-without-merge,
  push with no num_commits key, issue/PR events with number=0,
  untracked agent with agent_id field passthrough
- _detect_patterns: boundary conditions (< 3 PRs threshold, exactly 80%
  merge rate, commit count boundary at 10 vs 11, token net boundaries)
- _generate_narrative_bullets: singular/plural forms for all activity types
- generate_scorecard: token augmentation max() logic (event vs ledger)
- ScorecardSummary.to_dict: ISO timestamp format, tests_affected count

Fixes #1139

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 22:08:04 -04:00