Skip to content

Commit

Permalink
test: fix autogenroutes after modifying service label checks
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Oct 12, 2024
1 parent 1c4046f commit 0f1d75d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
32 changes: 30 additions & 2 deletions cmd/template_autogen_ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ func TestAutogeneratedIngressGeneration(t *testing.T) {
want: "internal/testdata/node/autogen-templates/ingress-10",
},
{
name: "test13 autogenerated route development service type override",
name: "test-development-service-type-override-a",
description: `this test should fail because the replacement type has no persistent label in the associated docker-compose file
realistically, this is not something that should be done on an already deployed service due to changing
service types not being properly supported`,
args: testdata.GetSeedData(
testdata.TestData{
ProjectName: "example-project",
Expand All @@ -230,7 +233,32 @@ func TestAutogeneratedIngressGeneration(t *testing.T) {
},
}, true),
templatePath: "testoutput",
want: "internal/testdata/node/autogen-templates/ingress-11",
emptyDir: true,
want: "",
wantErr: true,
},
{
name: "test-development-service-type-override-b",
description: `this test should pass because the replacement service type is just a basic type
realistically, this is not something that should be done on an already deployed service due to changing
service types not being properly supported`,
args: testdata.GetSeedData(
testdata.TestData{
ProjectName: "example-project",
EnvironmentName: "main",
Branch: "main",
EnvironmentType: "development",
LagoonYAML: "internal/testdata/node/lagoon.yml",
ProjectVariables: []lagoon.EnvironmentVariable{
{
Name: "LAGOON_SERVICE_TYPES",
Value: "node:basic",
Scope: "build",
},
},
}, true),
templatePath: "testoutput",
want: "internal/testdata/node/autogen-templates/test-development-service-type-override",
},
{
name: "test14 autogenerated route development no service type override",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ metadata:
lagoon.sh/environmentType: development
lagoon.sh/project: example-project
lagoon.sh/service: node
lagoon.sh/service-type: node-persistent
lagoon.sh/service-type: basic
lagoon.sh/template: autogenerated-ingress-0.1.0
name: node
spec:
Expand Down

0 comments on commit 0f1d75d

Please sign in to comment.