Finish native completion and retire legacy command machinery

This commit is contained in:
2026-11-20 06:32:47 +00:00
parent 7db626781e
commit faa8cb5822
72 changed files with 841 additions and 2966 deletions

View File

@@ -66,7 +66,7 @@ characters:
}
}
func TestArtifactSelectionFlagNormalize(t *testing.T) {
func TestNormalizeArtifactNames(t *testing.T) {
tests := []struct {
name string
inputs []string
@@ -92,14 +92,7 @@ func TestArtifactSelectionFlagNormalize(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
var flag artifactSelectionFlag
for _, in := range tt.inputs {
if err := flag.Set(in); err != nil {
t.Fatalf("Set(%q) error = %v", in, err)
}
}
got, err := flag.Normalize()
got, err := normalizeArtifactNames(tt.inputs)
if tt.wantErr != "" {
if err == nil {
t.Fatalf("Normalize() error = nil, want %q", tt.wantErr)
@@ -124,7 +117,7 @@ func TestArtifactSelectionFlagNormalize(t *testing.T) {
}
}
func TestValidateSelectedArtifacts(t *testing.T) {
func TestResolveSelectedArtifacts(t *testing.T) {
tests := []struct {
name string
cfg *config.Config
@@ -188,7 +181,10 @@ func TestValidateSelectedArtifacts(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
err := validateSelectedArtifacts(tt.cfg, tt.selected)
if tt.cfg.Pipeline != nil && tt.cfg.Pipeline.Scriptorium != nil {
tt.cfg.ArtifactCatalog = &config.ArtifactCatalog{Artifacts: tt.cfg.Pipeline.Scriptorium.Artifacts}
}
_, err := resolveEffectiveArtifacts(tt.cfg, tt.selected)
if tt.wantErr != "" {
if err == nil {
t.Fatalf("error = nil, want %q", tt.wantErr)