Files
pipelines/internal/tui/artifacts_debug_test.go
alan 57f5219628 Artifacts: runner-internal turn files move to a Debugging files group
Each recorded artifact now carries a server group (deliverable or debug).
public/ files are deliverables; input/memory/history/output.md, session
exports and private/ scratch are debugging files. The app's Artifacts tab
lists deliverables and the Debug toggle reveals a separate Debugging files
group (older servers fall back to the filename rule); the TUI lists
deliverables first and marks debug rows; artifact search excludes debug
files unless include_debug / --debug-files is set.
2026-11-04 17:43:47 +00:00

28 lines
1.0 KiB
Go

package tui
import (
"strings"
"testing"
"git.a-wan.net/alan/pipelines/internal/protocol"
)
func TestArtifactsDeliverablesLeadAndDebugFilesAreMarked(t *testing.T) {
artifacts := []protocol.StageArtifact{
{Name: "input.md", ContentType: "text/markdown", Group: protocol.ArtifactGroupDebug},
{Name: "history.md", ContentType: "text/markdown", Group: protocol.ArtifactGroupDebug},
{Name: "public/report.png", ContentType: "image/png", Group: protocol.ArtifactGroupDeliverable},
}
ordered := deliverablesFirst(artifacts)
if ordered[0].Name != "public/report.png" || ordered[1].Name != "input.md" || ordered[2].Name != "history.md" {
t.Fatalf("order = %+v", ordered)
}
widths := artifactWidthsFor([]artifactVisit{{artifacts: ordered}})
if row := artifactRowText(ordered[1], widths, 100, false); !strings.Contains(row, "[dbg] input.md") {
t.Fatalf("debug row not marked: %q", row)
}
if row := artifactRowText(ordered[0], widths, 100, false); !strings.Contains(row, "[img] public/report.png") {
t.Fatalf("deliverable row: %q", row)
}
}