Complete ConfigKit upgrade verification

This commit is contained in:
2026-11-17 21:00:27 +00:00
parent 74e0f454e9
commit c9744ad2e6
2 changed files with 37 additions and 0 deletions

View File

@@ -179,6 +179,34 @@ pipelines:
}
}
func TestIdentifiedStepRecordInheritance(t *testing.T) {
main := filepath.Join(t.TempDir(), "main.yml")
if err := os.WriteFile(main, []byte(`version: 5
pipelines:
session:
input: {module: input}
steps:
- id: parent
references: {source: {path: ./shared.txt}}
- id: child
extends: {id: parent}
artifacts: {result: {extract: {module: extract}}}
`), 0600); err != nil {
t.Fatal(err)
}
loaded, err := Load(main, LoadOptions{})
if err != nil {
t.Fatal(err)
}
steps := loaded.Config.Pipelines["session"].Steps
if len(steps) != 2 || steps[1].ID != "child" || steps[1].References["source"].Path != filepath.Join(filepath.Dir(main), "shared.txt") {
t.Fatalf("inherited step = %#v", steps)
}
if err := loaded.Config.Validate(); err != nil {
t.Fatalf("validate inherited steps: %v", err)
}
}
func TestEmptyStepOperationsAndOptionalImports(t *testing.T) {
root := t.TempDir()
main := filepath.Join(root, "main.yml")