Skip to content

Commit

Permalink
fix: errors in scripts
Browse files Browse the repository at this point in the history
- Wrong filepaths
- Format scripts
  • Loading branch information
josecelano committed May 14, 2024
1 parent 5f760cf commit ae06170
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion contrib/dev-tools/container/e2e/mysql/e2e-env-down.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

TORRUST_INDEX_CONFIG=$(cat ./share/default/config/index.e2e.container.mysql.toml) \
TORRUST_TRACKER_CONFIG_TOML=$(cat ./share/default/config/tracker.e2e.container.sqlite.toml) \
TORRUST_TRACKER_CONFIG_TOML=$(cat ./share/default/config/tracker.e2e.container.sqlite3.toml) \
docker compose down
11 changes: 7 additions & 4 deletions contrib/dev-tools/container/e2e/mysql/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export TORRUST_TRACKER_DATABASE="e2e_testing_sqlite3"
# It's needed by some tests to generate and parse test torrent files.
cargo install imdl || exit 1

# Install app (no docker) that will run the test suite against the E2E testing
# Install app (no docker) that will run the test suite against the E2E testing
# environment (in docker).
cp .env.local .env || exit 1

Expand All @@ -30,7 +30,7 @@ echo "Running E2E tests using MySQL ..."
# Wait for conatiners to be healthy
./contrib/dev-tools/container/functions/wait_for_container_to_be_healthy.sh torrust-mysql-1 10 3 || exit 1
./contrib/dev-tools/container/functions/wait_for_container_to_be_healthy.sh torrust-tracker-1 10 3 || exit 1
./contrib/dev-tools/container/functions/wait_for_container_to_be_healthy.sh torrust-index-1 10 3 || exit 1
./contrib/dev-tools/container/functions/wait_for_container_to_be_healthy.sh torrust-index-1 10 3 || exit 1

# Just to make sure that everything is up and running
docker ps
Expand All @@ -42,8 +42,11 @@ docker ps
TORRUST_INDEX_E2E_SHARED=true \
TORRUST_INDEX_E2E_PATH_CONFIG="./share/default/config/index.e2e.container.mysql.toml" \
TORRUST_INDEX_E2E_DB_CONNECT_URL="mysql://root:root_secret_password@localhost:3306/torrust_index_e2e_testing" \
cargo test \
|| { ./contrib/dev-tools/container/e2e/mysql/e2e-env-down.sh; exit 1; }
cargo test ||
{
./contrib/dev-tools/container/e2e/mysql/e2e-env-down.sh
exit 1
}

# Stop E2E testing environment
./contrib/dev-tools/container/e2e/mysql/e2e-env-down.sh || exit 1
2 changes: 1 addition & 1 deletion contrib/dev-tools/container/e2e/sqlite/e2e-env-down.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

TORRUST_INDEX_CONFIG=$(cat ./share/default/config/index.e2e.container.sqlite3.toml) \
TORRUST_TRACKER_CONFIG_TOML=$(cat ./share/default/config/tracker.e2e.container.sqlite3.toml) \
TORRUST_TRACKER_CONFIG_TOML=$(cat ./share/default/config/tracker.e2e.container.sqlite3.toml) \
docker compose down
2 changes: 1 addition & 1 deletion contrib/dev-tools/container/e2e/sqlite/e2e-env-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ USER_ID=${USER_ID:-1000} \
TORRUST_TRACKER_DATABASE="e2e_testing_sqlite3" \
TORRUST_TRACKER_CONFIG_OVERRIDE_DB_DRIVER="Sqlite3" \
TORRUST_TRACKER_CONFIG_OVERRIDE_HTTP_API__ACCESS_TOKENS__ADMIN="MyAccessToken" \
docker compose up --detach --pull always --remove-orphans
docker compose up --detach --pull always --remove-orphans
11 changes: 7 additions & 4 deletions contrib/dev-tools/container/e2e/sqlite/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export TORRUST_TRACKER_DATABASE="e2e_testing_sqlite3"
# It's needed by some tests to generate and parse test torrent files.
cargo install imdl || exit 1

# Install app (no docker) that will run the test suite against the E2E testing
# Install app (no docker) that will run the test suite against the E2E testing
# environment (in docker).
cp .env.local .env || exit 1
./contrib/dev-tools/container/e2e/sqlite/install.sh || exit 1
Expand All @@ -31,7 +31,7 @@ echo "Running E2E tests using SQLite ..."
# Wait for conatiners to be healthy
./contrib/dev-tools/container/functions/wait_for_container_to_be_healthy.sh torrust-mysql-1 10 3 || exit 1
./contrib/dev-tools/container/functions/wait_for_container_to_be_healthy.sh torrust-tracker-1 10 3 || exit 1
./contrib/dev-tools/container/functions/wait_for_container_to_be_healthy.sh torrust-index-1 10 3 || exit 1
./contrib/dev-tools/container/functions/wait_for_container_to_be_healthy.sh torrust-index-1 10 3 || exit 1

# Just to make sure that everything is up and running
docker ps
Expand All @@ -40,8 +40,11 @@ docker ps
TORRUST_INDEX_E2E_SHARED=true \
TORRUST_INDEX_E2E_PATH_CONFIG="./share/default/config/index.e2e.container.sqlite3.toml" \
TORRUST_INDEX_E2E_DB_CONNECT_URL="sqlite://./storage/index/lib/database/e2e_testing_sqlite3.db?mode=rwc" \
cargo test \
|| { ./contrib/dev-tools/container/e2e/sqlite/e2e-env-down.sh; exit 1; }
cargo test ||
{
./contrib/dev-tools/container/e2e/sqlite/e2e-env-down.sh
exit 1
}

# Stop E2E testing environment
./contrib/dev-tools/container/e2e/sqlite/e2e-env-down.sh || exit 1
6 changes: 3 additions & 3 deletions contrib/dev-tools/init/install-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Generate the Index sqlite database directory and file if it does not exist
mkdir -p ./storage/index/lib/database

if ! [ -f "./storage/index/lib/database/sqlite3.db.db" ]; then
echo "Creating index database 'sqlite3.db.db'"
sqlite3 "./storage/index/lib/database/sqlite3.db.db" "VACUUM;"
if ! [ -f "./storage/index/lib/database/sqlite3.db" ]; then
echo "Creating index database 'sqlite3.db'"
sqlite3 "./storage/index/lib/database/sqlite3.db" "VACUUM;"
fi

0 comments on commit ae06170

Please sign in to comment.