From ab9fa4f6be6abdd5235dc69ba67e30ae439ac276 Mon Sep 17 00:00:00 2001 From: Gerd Oberlechner Date: Wed, 4 Dec 2024 22:56:21 +0100 Subject: [PATCH] validate duplicate steps Signed-off-by: Gerd Oberlechner --- tooling/templatize/pkg/pipeline/run_test.go | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tooling/templatize/pkg/pipeline/run_test.go b/tooling/templatize/pkg/pipeline/run_test.go index 573f9bc26..e43537068 100644 --- a/tooling/templatize/pkg/pipeline/run_test.go +++ b/tooling/templatize/pkg/pipeline/run_test.go @@ -126,6 +126,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{