Complete ConfigKit upgrade verification
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user