Test environment stability improvements #703
Reference in New Issue
Block a user
Delete Branch "zachgoll/test-stability-improvements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
This is the second part of a series of PRs aimed to stabilize our dependencies and test suite so we're not getting unpredictable failures that have been happening as of late.
There will be 1-2 more PRs to finish this off, but wanted to open this in small increments for documentation purposes.
App Mode
As part of this PR, I have moved the config for self hosting directly into the environment configs under the key
app_mode, which can either beself_hostedormanaged.Good Job config
By default, GoodJob offers different execution modes based on the Rails environment (i.e. prod defaults to
:external, dev to:async, test to:inline), so I've consolidated the config intoapplication.rb.Prior, we didn't have anything set in test, so it was defaulting to the Rails
:asyncadapter (rather than the GoodJob:inlineadapter as expected).Test environment, overriding ENV in tests
Since the Maybe app will need to be tested under both "self hosted" mode and "managed" mode, I've introduced a first class helper to facilitate this:
Additionally, I've moved
dotenv-railsout of the:testgroup to be more explicit with the test environment and added another helper (leveraging theclimate_controlgem) to explicitly override environment variables for individual tests:Unrelated cleanup here that I missed in #702
Will be simplified and re-introduced in follow-up PR.