Skip to content

Commit fc1528d

Browse files
committed
feat: [#596] rename common E2E env vars
We should not use specific names (sufix _E2E) for env vars that are not specidif for E2E tests. These env vars are generic enva vars also used in production. They only have different values for the E2E test env. ``` TORRUST_INDEX_E2E_CONFIG -> TORRUST_INDEX_CONFIG TORRUST_INDEX_E2E_TRACKER_API_TOKEN -> TORRUST_INDEX_TRACKER_API_TOKEN TORRUST_INDEX_E2E_AUTH_SECRET_KEY -> TORRUST_INDEX_AUTH_SECRET_KEY TORRUST_INDEX_E2E_PATH_CONFIG -> TORRUST_INDEX_PATH_CONFIG ```
1 parent 9290cbb commit fc1528d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

contrib/dev-tools/container/e2e/mysql/run-e2e-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ docker ps
4040

4141
# Run E2E tests with shared app instance
4242
TORRUST_INDEX_E2E_SHARED=true \
43-
TORRUST_INDEX_E2E_PATH_CONFIG="./share/default/config/index.e2e.container.mysql.toml" \
43+
TORRUST_INDEX_PATH_CONFIG="./share/default/config/index.e2e.container.mysql.toml" \
4444
TORRUST_INDEX_E2E_DB_CONNECT_URL="mysql://root:root_secret_password@localhost:3306/torrust_index_e2e_testing" \
4545
cargo test ||
4646
{

contrib/dev-tools/container/e2e/sqlite/run-e2e-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ docker ps
3838

3939
# Run E2E tests with shared app instance
4040
TORRUST_INDEX_E2E_SHARED=true \
41-
TORRUST_INDEX_E2E_PATH_CONFIG="./share/default/config/index.e2e.container.sqlite3.toml" \
41+
TORRUST_INDEX_PATH_CONFIG="./share/default/config/index.e2e.container.sqlite3.toml" \
4242
TORRUST_INDEX_E2E_DB_CONNECT_URL="sqlite://./storage/index/lib/database/e2e_testing_sqlite3.db?mode=rwc" \
4343
cargo test ||
4444
{

tests/e2e/config.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ use torrust_index::config::{Configuration, Info};
99

1010
/// The whole `index.toml` file content. It has priority over the config file.
1111
/// Even if the file is not on the default path.
12-
const ENV_VAR_CONFIG: &str = "TORRUST_INDEX_E2E_CONFIG";
12+
const ENV_VAR_CONFIG: &str = "TORRUST_INDEX_CONFIG";
1313

1414
/// Token needed to communicate with the Torrust Tracker
15-
const ENV_VAR_API_ADMIN_TOKEN: &str = "TORRUST_INDEX_E2E_TRACKER_API_TOKEN";
15+
const ENV_VAR_API_ADMIN_TOKEN: &str = "TORRUST_INDEX_TRACKER_API_TOKEN";
1616

1717
/// Secret key used to encrypt and decrypt
18-
const ENV_VAR_AUTH_SECRET_KEY: &str = "TORRUST_INDEX_E2E_AUTH_SECRET_KEY";
18+
const ENV_VAR_AUTH_SECRET_KEY: &str = "TORRUST_INDEX_AUTH_SECRET_KEY";
1919

2020
/// The `index.toml` file location.
21-
pub const ENV_VAR_PATH_CONFIG: &str = "TORRUST_INDEX_E2E_PATH_CONFIG";
21+
pub const ENV_VAR_PATH_CONFIG: &str = "TORRUST_INDEX_PATH_CONFIG";
2222

2323
// Default values
2424
pub const DEFAULT_PATH_CONFIG: &str = "./share/default/config/index.development.sqlite3.toml";
@@ -34,7 +34,7 @@ pub const ENV_VAR_DB_CONNECT_URL: &str = "TORRUST_INDEX_E2E_DB_CONNECT_URL";
3434
/// There are two methods to inject the configuration:
3535
///
3636
/// 1. By using a config file: `index.toml`.
37-
/// 2. Environment variable: `TORRUST_INDEX_E2E_CONFIG`. The variable contains the same contents as the `index.toml` file.
37+
/// 2. Environment variable: `TORRUST_INDEX_CONFIG`. The variable contains the same contents as the `index.toml` file.
3838
///
3939
/// Environment variable has priority over the config file.
4040
///

0 commit comments

Comments
 (0)