Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
run: |
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) {
Comment on lines 51 to 55
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.
printf "Coverage %.1f%% is below floor %.1f%%\n", t, m
Expand Down
29 changes: 29 additions & 0 deletions render/depgraph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,32 @@ func TestDepgraphRendersExternalDepsAndSummarySection(t *testing.T) {
}
}
}

func TestDepgraphWrapsLongDependencyLines(t *testing.T) {
project := scanner.DepsProject{
Root: t.TempDir(),
Files: []scanner.FileAnalysis{
{Path: "main.go", Functions: []string{"main"}},
},
ExternalDeps: map[string][]string{
"go": {
"github.com/example/super-long-package-alpha",
"github.com/example/super-long-package-beta",
"github.com/example/super-long-package-gamma",
"github.com/example/super-long-package-delta",
"github.com/example/super-long-package-epsilon",
},
},
}

var buf bytes.Buffer
Depgraph(&buf, project)
output := buf.String()

if !strings.Contains(output, "Go:") {
t.Fatalf("expected go language dependency label, got:\n%s", output)
}
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.
}
76 changes: 76 additions & 0 deletions render/skyline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,79 @@ func TestSkylineMinMax(t *testing.T) {
})
}
}

func TestSkylineTickCmd(t *testing.T) {
cmd := tickCmd()
if cmd == nil {
t.Fatal("expected non-nil tick command")
}

msg := cmd()
if _, ok := msg.(tickMsg); !ok {
t.Fatalf("expected tickMsg, got %T", msg)
}
Comment on lines +283 to +287
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.
}

func TestSkylineAnimationModelInit(t *testing.T) {
m := animationModel{}
if cmd := m.Init(); cmd == nil {
t.Fatal("expected non-nil init command")
}
}

func TestSkylineAnimationModelUpdatePhaseTwo(t *testing.T) {
t.Run("starts shooting star at configured frame", func(t *testing.T) {
m := animationModel{
phase: 2,
frame: 9,
sceneLeft: 3,
}

updated, cmd := m.Update(tickMsg(time.Now()))
if cmd == nil {
t.Fatal("expected tick command")
}
got := updated.(animationModel)
if !got.shootingStarActive {
t.Fatal("expected shooting star to become active")
}
if got.shootingStarCol != m.sceneLeft {
t.Fatalf("shootingStarCol = %d, want %d", got.shootingStarCol, m.sceneLeft)
}
})

t.Run("deactivates shooting star after leaving scene", func(t *testing.T) {
m := animationModel{
phase: 2,
frame: 15,
sceneRight: 10,
shootingStarActive: true,
shootingStarCol: 9,
}

updated, cmd := m.Update(tickMsg(time.Now()))
if cmd == nil {
t.Fatal("expected tick command")
}
got := updated.(animationModel)
if got.shootingStarActive {
t.Fatal("expected shooting star to deactivate after leaving scene")
}
})

t.Run("quits after final frame", func(t *testing.T) {
m := animationModel{
phase: 2,
frame: 39,
}

updated, cmd := m.Update(tickMsg(time.Now()))
if cmd == nil {
t.Fatal("expected quit command")
}
got := updated.(animationModel)
if !got.done {
t.Fatal("expected animation model to be marked done")
}
})
}
Loading