[claude] Add unit tests for scorecard_service.py (#1139) #1320
Reference in New Issue
Block a user
Delete Branch "claude/issue-1139"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1139
Adds
tests/dashboard/test_scorecard_service.pywith 31 unit tests covering edge cases and boundary conditions inscorecard_service.pynot addressed by the existingtest_scorecards.py:_aggregate_metrics:test.executionevent type, PR-closed-without-merge, push with missingnum_commitskey, issue/PR events withnumber=0, untracked agent withagent_idfield passthrough, multi-agent independence_detect_patterns: boundary conditions — fewer than 3 PRs skips merge rate check, exactly 80% triggers high-merge-rate pattern, commit threshold at 10 vs 11, token net boundaries at 100 and -50_generate_narrative_bullets: singular/plural forms for all activity types (commit, PR, issue, comment, test file) and weekly period labelgenerate_scorecard:max()token augmentation logic (event tokens vs ledger tokens)ScorecardSummary.to_dict(): ISO timestamp format,tests_affectedcount serialization