Infer artifact dependencies from configured inputs
This commit is contained in:
@@ -395,7 +395,7 @@ func TestScriptoriumLoadAndValidate(t *testing.T) {
|
||||
wantValidateErr: []string{"pipeline.scriptorium.artifacts.session_recap.output_path", "under artifacts/"},
|
||||
},
|
||||
{
|
||||
name: "missing depends_on for artifact source fails validation",
|
||||
name: "artifact source infers dependency",
|
||||
scriptoriumYAML: `scriptorium:
|
||||
binary: scriptorium
|
||||
artifacts:
|
||||
@@ -416,7 +416,13 @@ func TestScriptoriumLoadAndValidate(t *testing.T) {
|
||||
source: narratio.artifact.session_recap
|
||||
required: true
|
||||
`,
|
||||
wantValidateErr: []string{"pipeline.scriptorium.artifacts.player_handout.inputs.recap.source", "requires depends_on"},
|
||||
assert: func(t *testing.T, cfg *Config) {
|
||||
t.Helper()
|
||||
dependencies := cfg.Pipeline.Scriptorium.Artifacts["player_handout"].DependsOn
|
||||
if len(dependencies) != 1 || dependencies[0] != "session_recap" {
|
||||
t.Fatalf("inferred dependencies = %#v, want [session_recap]", dependencies)
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "dependency on unknown artifact fails validation",
|
||||
|
||||
Reference in New Issue
Block a user