Skip to content

test: improve render coverage from 78.5% to 81.1%#63

Closed
JordanCoin wants to merge 1 commit intomainfrom
automation/test-coverage-render-20260330
Closed

test: improve render coverage from 78.5% to 81.1%#63
JordanCoin wants to merge 1 commit intomainfrom
automation/test-coverage-render-20260330

Conversation

@JordanCoin
Copy link
Copy Markdown
Owner

Summary

  • add deterministic render tests for skyline animation tick/init/update phase transitions
  • add depgraph coverage for long external dependency line wrapping
  • raise CI enforce coverage floor from 45.0 to 50.0 (total coverage now exceeds floor + 5)

Coverage

Scope Before After
render 78.5% 81.1%
total 72.2% 72.6%

Validation

  • go test -coverprofile=coverage.out ./...
  • go test -cover ./...
  • go vet ./...
  • gofmt -l .
  • go test -race -coverprofile=coverage_race.out ./... (fails in root package tests under sandbox: TestBasicTreeOutput, TestMultipleFlags)

Copy link
Copy Markdown

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

This PR increases render-related test coverage by adding new deterministic tests around skyline animation behavior and depgraph rendering, and tightens CI enforcement by raising the minimum required overall coverage.

Changes:

  • Added unit tests for skyline tick/init and phase-2 animation transitions (shooting star, completion).
  • Added a depgraph test intended to cover long external dependency line wrapping behavior.
  • Increased the CI coverage floor from 45.0% to 50.0%.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
render/skyline_test.go Adds tests for tickCmd, animationModel.Init, and phase-2 Update transitions to improve render coverage.
render/depgraph_test.go Adds a test targeting long external dependency output (wrapping/formatting) to improve depgraph coverage.
.github/workflows/ci.yml Raises the enforced minimum coverage threshold to 50.0% in CI.

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

Comment on lines +283 to +287

msg := cmd()
if _, ok := msg.(tickMsg); !ok {
t.Fatalf("expected tickMsg, got %T", msg)
}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

TestSkylineTickCmd invokes the tea.Tick command (cmd()), which will sleep for the configured 60ms tick interval. This introduces real time delays into the unit test suite and can slow/flakify CI; consider only asserting cmd is non-nil, or refactor tickCmd to allow injecting a zero/short duration in tests so the command can be executed without waiting.

Suggested change
msg := cmd()
if _, ok := msg.(tickMsg); !ok {
t.Fatalf("expected tickMsg, got %T", msg)
}

Copilot uses AI. Check for mistakes.
}
if !strings.Contains(output, "super-long-package-alpha") || !strings.Contains(output, "super-long-package-epsilon") {
t.Fatalf("expected long dependency names to be present, got:\n%s", output)
}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

TestDepgraphWrapsLongDependencyLines doesn't currently assert any wrapping behavior (e.g., a continuation line or indentation) — it only checks that dependency names are present, which would also pass if wrapping regressed. To validate wrapping, assert that the output contains at least one wrapped/continued line for the Go dependency section (for example, multiple boxed lines for the Go deps and/or the expected continuation indentation).

Suggested change
}
}
// Ensure that the Go dependency section is actually wrapped across multiple lines,
// not rendered as a single overly long line.
lines := strings.Split(output, "\n")
wrappedLines := 0
for _, line := range lines {
if strings.Contains(line, "super-long-package") {
wrappedLines++
}
}
if wrappedLines < 2 {
t.Fatalf("expected Go dependencies to be wrapped across multiple lines (found %d line), got:\n%s", wrappedLines, output)
}

Copilot uses AI. Check for mistakes.
Comment on lines 51 to 55
total=$(go tool cover -func=coverage.out | awk '/^total:/ {gsub("%","",$3); print $3}')
# Current enforced coverage floor. Codex PRs raise this incrementally toward 90%.
min=45.0
min=50.0
awk -v t="$total" -v m="$min" 'BEGIN {
if (t+0 < m+0) {
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The enforced coverage floor is raised to 50.0 here, but the badge color range configuration later in this workflow still uses minColorRange: 45. If the badge is meant to reflect the enforced floor, consider updating minColorRange to 50 (or sourcing it from the same variable) to avoid showing a green-ish badge while the job would fail below 50%.

Copilot uses AI. Check for mistakes.
@JordanCoin JordanCoin closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants