Skip to content

Commit

Permalink
fix: [#342] fix en vars to run E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Nov 14, 2023
1 parent 48ec4b1 commit 03943ef
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions contrib/dev-tools/container/e2e/mysql/e2e-env-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ TORRUST_INDEX_CONFIG=$(cat ./share/default/config/index.container.mysql.toml) \
docker compose build

USER_ID=${USER_ID:-1000} \
# Index
TORRUST_INDEX_CONFIG=$(cat ./share/default/config/index.container.mysql.toml) \
TORRUST_INDEX_DATABASE_DRIVER="mysql" \
TORRUST_INDEX_TRACKER_API_TOKEN="MyAccessToken" \
TORRUST_IDX_BACK_MYSQL_DATABASE="torrust_index_e2e_testing" \
# Tracker
TORRUST_TRACKER_CONFIG=$(cat ./share/default/config/tracker.container.mysql.toml) \
TORRUST_TRACKER_DATABASE_DRIVER="mysql" \
TORRUST_TRACKER_API_ADMIN_TOKEN="MyAccessToken" \
Expand Down
4 changes: 2 additions & 2 deletions contrib/dev-tools/container/e2e/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ sleep 20s
docker ps

# Run E2E tests with shared app instance
TORRUST_IDX_BACK_E2E_SHARED=true TORRUST_IDX_BACK_E2E_CONFIG_PATH="./share/default/config/index.container.sqlite3.toml" cargo test || exit 1
TORRUST_INDEX_E2E_SHARED=true TORRUST_INDEX_E2E_PATH_CONFIG="./share/default/config/index.container.sqlite3.toml" cargo test || exit 1

# Stop E2E testing environment
./contrib/dev-tools/container/e2e/sqlite/e2e-env-down.sh || exit 1
Expand Down Expand Up @@ -91,7 +91,7 @@ echo "Creating MySQL database $MYSQL_DATABASE for for E2E testing ..."
mysql -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD -e "CREATE DATABASE IF NOT EXISTS $MYSQL_DATABASE;"

# Run E2E tests with shared app instance
TORRUST_IDX_BACK_E2E_SHARED=true TORRUST_IDX_BACK_E2E_CONFIG_PATH="./share/default/config/index.container.mysql.toml" cargo test || exit 1
TORRUST_INDEX_E2E_SHARED=true TORRUST_INDEX_E2E_PATH_CONFIG="./share/default/config/index.container.mysql.toml" cargo test || exit 1

# Stop E2E testing environment
./contrib/dev-tools/container/e2e/mysql/e2e-env-down.sh || exit 1
Expand Down
2 changes: 0 additions & 2 deletions contrib/dev-tools/container/e2e/sqlite/e2e-env-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ TORRUST_INDEX_CONFIG=$(cat ./share/default/config/index.container.sqlite3.toml)
docker compose build

USER_ID=${USER_ID:-1000} \
# Index
TORRUST_INDEX_CONFIG=$(cat ./share/default/config/index.container.sqlite3.toml) \
TORRUST_INDEX_DATABASE_DRIVER="sqlite3" \
TORRUST_INDEX_TRACKER_API_TOKEN="MyAccessToken" \
# Tracker
TORRUST_TRACKER_CONFIG=$(cat ./share/default/config/tracker.container.sqlite3.toml) \
TORRUST_TRACKER_DATABASE_DRIVER="sqlite3" \
TORRUST_TRACKER_API_ADMIN_TOKEN="MyAccessToken" \
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
//! against an in-process server (isolated).
//!
//! If you want to run the tests against an out-of-process server, you need to
//! set the environment variable `TORRUST_IDX_BACK_E2E_SHARED` to `true`.
//! set the environment variable `TORRUST_INDEX_E2E_SHARED` to `true`.
//!
//! > **NOTICE**: The server must be running before running the tests. The
//! server url is hardcoded to `http://localhost:3001` for now. We are planning
//! to make it configurable in the future via a environment variable.
//!
//! ```text
//! TORRUST_IDX_BACK_E2E_SHARED=true cargo test
//! TORRUST_INDEX_E2E_SHARED=true cargo test
//! ```
//!
//! If you want to run the tests against an isolated server, you need to execute
Expand Down

0 comments on commit 03943ef

Please sign in to comment.