Skip to content

Commit

Permalink
validate duplicate steps
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Oberlechner <[email protected]>
  • Loading branch information
geoberle committed Dec 4, 2024
1 parent 3759a16 commit 6e02a38
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions tooling/templatize/pkg/pipeline/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,6 @@ func TestRGValidate(t *testing.T) {
rg: &ResourceGroup{Name: "test"},
err: "subscription is required",
},
{
name: "missing dependency",
rg: &ResourceGroup{
Name: "test",
Subscription: "test",
Steps: []*Step{
{
Name: "step2",
DependsOn: []string{"step"},
},
},
},
err: "invalid dependency from step step2 to step",
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
Expand Down Expand Up @@ -126,6 +112,32 @@ func TestPipelineValidate(t *testing.T) {
},
err: "invalid dependency on step step2: dependency step3 does not exist",
},
{
name: "duplicate step name",
pipeline: &Pipeline{
ResourceGroups: []*ResourceGroup{
{
Name: "rg1",
Subscription: "sub1",
Steps: []*Step{
{
Name: "step1",
},
},
},
{
Name: "rg2",
Subscription: "sub1",
Steps: []*Step{
{
Name: "step1",
},
},
},
},
},
err: "duplicate step name \"step1\"",
},
{
name: "valid step dependencies",
pipeline: &Pipeline{
Expand Down

0 comments on commit 6e02a38

Please sign in to comment.