Skip to content

Commit 9bc26fe

Browse files
committed
Test e2e-image against staging environment
Previously the Docker image to run end to end tests and smoke tests was being tested against both the dev and production environments before pushing (dev environment for the end to end tests, production environment for the smoke tests). This seems a bit more convoluted than necessary, and was a cause for surprise and failures with the e2e-image pipeline recently when I was making changes to how forms-e2e-tests gets its configuration (see PR #1940 for more details). In future we'd like to have the e2e-image pipeline test the end to end tests and smoke tests against the same environment, to simplify the configuration logic of forms-e2e-tests and make it more consistent with the configuration of our apps. Why weren't we using the same environment for testing both end to end tests and smoke tests already? The reasons aren't documented, but we can make some guesses... there is some sense to it; the smoke tests run using the latest e2e-image, so we probably want to make sure the smoke tests pass against production before promoting the image, and dev might be different enough that a pass there doesn't mean a pass on production. On the other hand, we might not want to run an untested version of the end to end tests against production in case they mess up and do something really bad... but then again the end to end tests are not gated by the e2e-image pipeline in the same way as the smoke tests are so this may not be as much of a concern. Running the smoke tests and end to end tests against the staging environment seems like a reasonable compromise; staging should be as close to production as possible, but if the end to end tests do something bad and break things then it's also less of an issue. This also matches more closely what our app and terraform release pipelines do; testing against staging before releasing to production.
1 parent 6e97595 commit 9bc26fe

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

infra/deployments/deploy/e2e-tests-image-builder/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# However, the end-to-end tests container building CodeBuild job has an extra
66
# step within the buildspec which runs the tests in the container against the
7-
# dev environment, for which it needs credentials from the
7+
# staging environment, for which it needs credentials from the
88
# 'automated-test-parameters' module.
99
#
1010
# https://github.com/alphagov/forms-e2e-tests/blob/main/bin/dockerfile_test.sh

infra/modules/e2e-image-pipeline/codepipeline.tf

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,42 +76,42 @@ module "docker_build" {
7676
extra_env_vars = [
7777
{
7878
name = "SETTINGS__FORMS_ENV"
79-
value = "dev"
79+
value = "staging"
8080
type = "PLAINTEXT"
8181
},
8282
{
8383
name = "SETTINGS__FORM_IDS__SMOKE_TEST"
84-
value = "2570"
84+
value = "12148"
8585
type = "PLAINTEXT"
8686
},
8787
{
8888
name = "SETTINGS__FORM_IDS__S3"
89-
value = "12457"
89+
value = "13657"
9090
type = "PLAINTEXT"
9191
},
9292
{
9393
name = "SETTINGS__FORMS_ADMIN__URL"
94-
value = "https://admin.dev.forms.service.gov.uk"
94+
value = "https://admin.staging.forms.service.gov.uk"
9595
type = "PLAINTEXT"
9696
},
9797
{
9898
name = "SETTINGS__FORMS_ADMIN__AUTH__USERNAME"
99-
value = "/dev/automated-tests/e2e/auth0/email-username"
99+
value = "/staging/automated-tests/e2e/auth0/email-username"
100100
type = "PARAMETER_STORE"
101101
},
102102
{
103103
name = "SETTINGS__FORMS_ADMIN__AUTH__PASSWORD"
104-
value = "/dev/automated-tests/e2e/auth0/auth0-user-password"
104+
value = "/staging/automated-tests/e2e/auth0/auth0-user-password"
105105
type = "PARAMETER_STORE"
106106
},
107107
{
108108
name = "SETTINGS__FORMS_PRODUCT_PAGE__URL"
109-
value = "https://dev.forms.service.gov.uk"
109+
value = "https://staging.forms.service.gov.uk"
110110
type = "PLAINTEXT"
111111
},
112112
{
113113
name = "SETTINGS__FORMS_RUNNER__URL"
114-
value = "https://submit.dev.forms.service.gov.uk"
114+
value = "https://submit.staging.forms.service.gov.uk"
115115
type = "PLAINTEXT"
116116
},
117117
{
@@ -121,17 +121,17 @@ module "docker_build" {
121121
},
122122
{
123123
name = "SETTINGS__AWS__S3_SUBMISSION_IAM_ROLE_ARN"
124-
value = "arn:aws:iam::498160065950:role/govuk-s3-end-to-end-test-dev"
124+
value = "arn:aws:iam::972536609845:role/govuk-s3-end-to-end-test-staging"
125125
type = "PLAINTEXT"
126126
},
127127
{
128128
name = "SETTINGS__GOVUK_NOTIFY__API_KEY"
129-
value = "/dev/automated-tests/e2e/notify/api-key"
129+
value = "/staging/automated-tests/e2e/notify/api-key"
130130
type = "PARAMETER_STORE"
131131
},
132132
{
133133
name = "SETTINGS__SUBMISSION_STATUS_API__SECRET"
134-
value = "/dev/automated-tests/e2e/runner/submission_status_api_shared_secret"
134+
value = "/staging/automated-tests/e2e/runner/submission_status_api_shared_secret"
135135
type = "PARAMETER_STORE"
136136
},
137137
]

0 commit comments

Comments
 (0)