generated from mathias/template-go-web
fix(atlas): treat skipped jobs as OK in run aggregate
Tag-push runs skip the deploy job (deploy is main-only), so runs with a skipped job were mislabelled "running" in the timeline. Skipped now counts as completed- OK; only genuinely in-progress states aggregate to running. Test-first. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -89,6 +89,16 @@ func TestRecentRuns_GroupsRunsNewestFirstWithAggregateState(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunState_SkippedJobsCountAsOK(t *testing.T) {
|
||||
// A tag-push run skips the deploy job; the run still succeeded.
|
||||
s := atlas.RunSummary{Jobs: []atlas.Job{
|
||||
{Status: "skipped"}, {Status: "success"}, {Status: "success"},
|
||||
}}
|
||||
if s.State() != "success" {
|
||||
t.Fatalf("skipped+success run state = %q, want success", s.State())
|
||||
}
|
||||
}
|
||||
|
||||
func TestLatestRunJobs_ErrorsWhenEmpty(t *testing.T) {
|
||||
if _, err := atlas.LatestRunJobs([]byte(`{"workflow_runs":[]}`)); err == nil {
|
||||
t.Fatal("expected error on empty, got nil")
|
||||
|
||||
Reference in New Issue
Block a user