Share catalog-independent pipeline layout
This commit is contained in:
22
internal/core/config/layout_contract_test.go
Normal file
22
internal/core/config/layout_contract_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
||||
)
|
||||
|
||||
func TestValidateUsesMapIdentityWithoutMutatingProfile(t *testing.T) {
|
||||
cfg := Default()
|
||||
cfg.Pipelines[" demo "] = pipeline.PipelineProfile{Artifacts: map[string]pipeline.ArtifactLaneProfile{" lane ": {}}}
|
||||
if err := cfg.Validate(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
profile := cfg.Pipelines[" demo "]
|
||||
if profile.ID != "" || len(profile.Artifacts) != 1 {
|
||||
t.Fatalf("validation mutated profile: %#v", profile)
|
||||
}
|
||||
if _, ok := profile.Artifacts[" lane "]; !ok {
|
||||
t.Fatalf("validation changed lane identity: %#v", profile.Artifacts)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user