Skip to content

test: improve render coverage from 7.8% to 18.6%#34

Merged
JordanCoin merged 2 commits intomainfrom
automation/test-coverage-render-20260302
Mar 3, 2026
Merged

test: improve render coverage from 7.8% to 18.6%#34
JordanCoin merged 2 commits intomainfrom
automation/test-coverage-render-20260302

Conversation

@JordanCoin
Copy link
Owner

Summary

  • add deterministic table-driven tests for render helper logic in render/tree_test.go
  • cover titleCase, getSystemName, filterCodeFiles, aggregateByExtension, getBuildingChar, createBuildings, and empty-source Depgraph
  • keep production source unchanged (tests only)

Coverage

Package Before After
codemap/render 7.8% 18.6%
TOTAL 34.8% 36.9%

Validation

  • go test -race -coverprofile=coverage.out ./...
  • go vet ./...
  • gofmt -l .

Coverage Floor

Current CI floor in .github/workflows/ci.yml is min=30.0.
Total coverage increase is +2.1 points, so floor was not bumped (requires +5).

Copilot AI review requested due to automatic review settings March 2, 2026 14:13
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds targeted unit tests in codemap/render to increase coverage of rendering helpers (tree/skyline/depgraph) without changing production code.

Changes:

  • Adds table-driven tests for titleCase, getSystemName, filterCodeFiles, aggregateByExtension, and getBuildingChar.
  • Adds tests for createBuildings layout/label trimming and Depgraph empty-source output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +435 to +438
t.Run("drops buildings until layout fits width budget", func(t *testing.T) {
rng = rand.New(rand.NewPCG(42, 0))
sorted := []extAgg{
{ext: ".go", size: 1000, count: 1},
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

Same global-state issue here: the subtest overwrites the package-level rng without restoring it. Consider using old := rng; rng = ...; t.Cleanup(func(){ rng = old }) to keep tests isolated.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@JordanCoin JordanCoin merged commit c1bfa39 into main Mar 3, 2026
12 checks passed
@JordanCoin JordanCoin deleted the automation/test-coverage-render-20260302 branch March 3, 2026 02:47
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.

2 participants