Skip to content

Conversation

@josecelano
Copy link
Member

@josecelano josecelano commented May 4, 2023

The test it_should_allow_admins_to_update_all_the_settings overwrites the config file config.toml. It uses the same values but:

  1. That does not assert that the file was actually updated.
  2. It can lead to conflicts with other tests since they all use the same shared env.

It should be fine for isolated environments because we inject the configuration into the app directly (not getting it from the environment via config file or env var).

This PR fixes it by running only the tests for isolated envs.

The PR includes other refactorings for configuration.

The test `it_should_allow_admins_to_update_all_the_settings` overwrites
the config file `config.toml`. It uses the same values but:

1. That does not assert that the file was actually updated.
2. It can lead to conflicts with other tests since all of them use the
   same shared env.

For isolated environments, it should not be a problem becuase we inject
the configuration into the app directly wuthout getting it from the
environment via confif file or env var.
@josecelano
Copy link
Member Author

The firs commit fixed the issue #130 but I'm going to refactor other parts related to configuration.

@josecelano josecelano requested review from MCM-Mike and da2ce7 May 4, 2023 18:27
@josecelano josecelano added the Code Cleanup / Refactoring Tidying and Making Neat label May 4, 2023
@josecelano josecelano requested review from mickvandijke and removed request for MCM-Mike May 4, 2023 19:07
Clean code for E2E test env configuration initialization.

And the configuration is loaded from the same config file used to start the
docker container: `config-idx-back.local.toml`.
@josecelano josecelano marked this pull request as ready for review May 4, 2023 19:43
@josecelano josecelano merged commit 7dbcafd into torrust:develop May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Cleanup / Refactoring Tidying and Making Neat

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Running E2E tests resets the config.toml file in the root dir to default values

1 participant