Skip to content

Commit

Permalink
chore: add test for autogenerated enabled, disabled by environment (#247
Browse files Browse the repository at this point in the history
)
  • Loading branch information
shreddedbacon authored Oct 26, 2023
1 parent 13f1e76 commit 63fdf16
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cmd/template_autogen_ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,25 @@ func TestAutogeneratedIngressGeneration(t *testing.T) {
emptyDir: false,
want: "../test-resources/template-autogenerated/test24-results",
},
{
name: "test25 autogenerated routes enabled globally but disabled by environment",
args: args{
alertContact: "alertcontact",
statusPageID: "statuspageid",
projectName: "example-project",
environmentName: "main",
environmentType: "production",
buildType: "branch",
lagoonVersion: "v2.7.x",
branch: "main",
projectVars: `[{"name":"LAGOON_SYSTEM_ROUTER_PATTERN","value":"${service}-${project}-${environment}.example.com","scope":"internal_system"}]`,
envVars: `[]`,
lagoonYAML: "../test-resources/template-autogenerated/test25/lagoon.yml",
templatePath: "../test-resources/template-autogenerated/output",
},
emptyDir: true,
want: "",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
20 changes: 20 additions & 0 deletions test-resources/template-autogenerated/test25/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '2'
services:
node:
networks:
- amazeeio-network
- default
build:
context: .
dockerfile: node.dockerfile
labels:
lagoon.type: node
volumes:
- .:/app:delegated
environment:
- LAGOON_LOCALDEV_HTTP_PORT=3000
- LAGOON_ROUTE=http://node.docker.amazee.io

networks:
amazeeio-network:
external: true
17 changes: 17 additions & 0 deletions test-resources/template-autogenerated/test25/lagoon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
docker-compose-yaml: ../test-resources/template-autogenerated/test6/docker-compose.yml

routes:
autogenerate:
enabled: true
insecure: Redirect
allowPullrequests: false

environment_variables:
git_sha: "true"

environments:
main:
autogenerateRoutes: false
routes:
- node:
- example.com

0 comments on commit 63fdf16

Please sign in to comment.