Finish native completion and retire legacy command machinery
This commit is contained in:
@@ -115,14 +115,6 @@ notarius:
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
firstValues, err := EffectivePipelineValues(first)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
serializedValues := ""
|
||||
for _, value := range firstValues {
|
||||
serializedValues += value.Path + "=" + value.Value + "\n"
|
||||
}
|
||||
directYAML, err := yaml.Marshal(first)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -131,7 +123,7 @@ notarius:
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, output := range []string{string(firstYAML), serializedValues, string(directYAML), string(directJSON)} {
|
||||
for _, output := range []string{string(firstYAML), string(directYAML), string(directJSON)} {
|
||||
if strings.Contains(output, firstCanary) {
|
||||
t.Fatalf("effective output exposed credential value: %q", output)
|
||||
}
|
||||
@@ -165,12 +157,12 @@ notarius:
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
secondValues, err := EffectivePipelineValues(second)
|
||||
secondYAML, err := MarshalEffectivePipeline(second)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(firstValues, secondValues) {
|
||||
t.Fatalf("credential value change altered effective projection:\nfirst=%#v\nsecond=%#v", firstValues, secondValues)
|
||||
if string(firstYAML) != string(secondYAML) {
|
||||
t.Fatal("credential value change altered safe materialization")
|
||||
}
|
||||
if EffectivePipelineDigest(first) != EffectivePipelineDigest(second) {
|
||||
t.Fatal("credential value change altered effective digest")
|
||||
@@ -195,16 +187,12 @@ notarius:
|
||||
}
|
||||
}
|
||||
|
||||
func TestEffectivePipelineValuesPreserveNilEmptyAndExactIntegers(t *testing.T) {
|
||||
func TestPipelineMaterializationPreservesNilEmptyAndExactIntegers(t *testing.T) {
|
||||
base := &PipelineConfig{
|
||||
Audita: AuditaConfig{Modules: nil},
|
||||
Scriptorium: &ScriptoriumConfig{Artifacts: nil},
|
||||
resolution: &pipelineResolutionMetadata{},
|
||||
}
|
||||
nilValues, err := EffectivePipelineValues(base)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
nilYAML, err := MarshalEffectivePipeline(base)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -237,19 +225,6 @@ func TestEffectivePipelineValuesPreserveNilEmptyAndExactIntegers(t *testing.T) {
|
||||
base.Scriptorium.Artifacts = map[string]ScriptoriumArtifactConfig{
|
||||
"recap": {Vars: map[string]any{"exact": int64(9007199254740993)}},
|
||||
}
|
||||
emptyValues, err := EffectivePipelineValues(base)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got := effectiveValueForTest(t, nilValues, "audita.modules"); got != "null" {
|
||||
t.Fatalf("nil sequence value = %q, want null", got)
|
||||
}
|
||||
if got := effectiveValueForTest(t, emptyValues, "audita.modules"); got != "[]" {
|
||||
t.Fatalf("empty sequence value = %q, want []", got)
|
||||
}
|
||||
if got := effectiveValueForTest(t, emptyValues, "scriptorium.artifacts.recap.vars.exact"); got != "9007199254740993" {
|
||||
t.Fatalf("exact integer value = %q", got)
|
||||
}
|
||||
if err := recomputePipelineEffectiveDigest(base); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -262,17 +237,6 @@ func TestEffectivePipelineValuesPreserveNilEmptyAndExactIntegers(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func effectiveValueForTest(t *testing.T, values []EffectivePipelineValueRecord, path string) string {
|
||||
t.Helper()
|
||||
for _, value := range values {
|
||||
if value.Path == path {
|
||||
return value.Value
|
||||
}
|
||||
}
|
||||
t.Fatalf("effective value %q not found", path)
|
||||
return ""
|
||||
}
|
||||
|
||||
func TestValidateMissingAudioSource(t *testing.T) {
|
||||
cfg := loadedValidConfig(t)
|
||||
cfg.Session.Inputs.AudioDir = ""
|
||||
|
||||
Reference in New Issue
Block a user