Skip to content

Conversation

@lfdebrux
Copy link
Member

@lfdebrux lfdebrux commented Jan 5, 2026

What problem does this pull request solve?

Currently setting secrets and configuration variables for the end to end tests is very different to how its done for our apps. I find this a little confusing, and it also makes some things harder that they would be for our apps; for instance, there isn't a consistent way to set defaults in files, or have local overrides.

This PR attempts to make the end to end tests more similar to our apps in the way they're configured. We do this by adding the config gem (same as we use in our apps), and renaming settings so that the names are the same or consistent with the names for settings in our apps.

Note that this PR doesn't change all environment variables that the end to end tests use: things like setting the log level are set outside the config gem in our apps, so it felt natural to do the same here; and the functionality to skip certain parts of the tests feels like it doesn't really belong in environment variables/settings at all, so I've left that as is for now.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Has all relevant documentation been updated?

stephencdaly
stephencdaly previously approved these changes Jan 5, 2026
@lfdebrux lfdebrux force-pushed the ldeb-add-config branch 2 times, most recently from 05fdca2 to a826aad Compare January 6, 2026 08:11
@lfdebrux lfdebrux requested a review from stephencdaly January 7, 2026 08:04
There is no longer code in our tests for the Auth0 passwordless
connection, so the `USE_AUTH0_PASSWORDLESS_CONNECTION` envvar does
nothing. This commit updates our README to reflect this.
Add an environment variable with the name of the AWS environment the end
to end tests are being run against. The name of the environment variable
is based on that set for our apps in the forms-deploy repo.

Nothing in our end to end tests themselves use this currently, but it
will become more useful later on.
This is the same gem we use to configure our apps.

https://github.com/rubyconfig/config
Add the files required to use the config gem (mostly copied from our
Rails apps), plus the code to load the gem and settings into the tests,
along with scaffolding/default settings.

The default environment is called "development", to align with the
development environment/settings in our Rails apps. This refers to a
developer environment with apps running locally, rather than the "dev"
environment in AWS.
This commit can be reverted once we've updated code that runs the end to
end tests to use the new environment variables.
@lfdebrux lfdebrux added this pull request to the merge queue Jan 8, 2026
Merged via the queue into main with commit 0b1b6c5 Jan 8, 2026
2 checks passed
@lfdebrux lfdebrux deleted the ldeb-add-config branch January 8, 2026 06:38
lfdebrux added a commit to alphagov/forms-deploy that referenced this pull request Jan 8, 2026
…e tests

The end to end and smoke tests in forms-e2e-tests now use the config
gem for configuring parameters and secrets, same as our other apps (see
PR alphagov/forms-e2e-tests#213).

This has resulted in a change of the names for the environment
variables. The configuration is mostly backwards compatible, but it
would be good to use the new environment variable names in our
Terraform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants