-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #252: Run E2E tests also using MySQL
0b29678 refactor(ci): reorganize E2E testing scripts (Jose Celano) 22b8f8a fix: [#223] HTTP error status code trying to insert duplicate category in MySQL (Jose Celano) c6346a5 test: [#223] run E2E with MySQL too (Jose Celano) Pull request description: E2E tests are only executed with SQLite. Top commit has no ACKs. Tree-SHA512: 07e0197e9fd8e5341511ed3097ef364e6148bf282bd09382bdbda878eeaaa6d4f331d683cb15a7eadfa4cb7fe51df45e2424ddb3514c990d98875717c755588f
- Loading branch information
Showing
16 changed files
with
205 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
log_level = "info" | ||
|
||
[website] | ||
name = "Torrust" | ||
|
||
[tracker] | ||
url = "udp://tracker:6969" | ||
mode = "Public" | ||
api_url = "http://tracker:1212" | ||
token = "MyAccessToken" | ||
token_valid_seconds = 7257600 | ||
|
||
[net] | ||
port = 3001 | ||
|
||
[auth] | ||
email_on_signup = "Optional" | ||
min_password_length = 6 | ||
max_password_length = 64 | ||
secret_key = "MaxVerstappenWC2021" | ||
|
||
[database] | ||
connect_url = "mysql://root:root_secret_password@mysql:3306/torrust_index_backend_e2e_testing" | ||
|
||
[mail] | ||
email_verification_enabled = false | ||
from = "[email protected]" | ||
reply_to = "[email protected]" | ||
username = "" | ||
password = "" | ||
server = "mailcatcher" | ||
port = 1025 | ||
|
||
[image_cache] | ||
max_request_timeout_ms = 1000 | ||
capacity = 128000000 | ||
entry_size_limit = 4000000 | ||
user_quota_period_seconds = 3600 | ||
user_quota_bytes = 64000000 | ||
|
||
[api] | ||
default_torrent_page_size = 10 | ||
max_torrent_page_size = 30 | ||
|
||
[tracker_statistics_importer] | ||
torrent_info_update_interval = 3600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# Delete the databases and recreate them. | ||
|
||
docker compose down | ||
|
||
# Index Backend | ||
|
||
# Database credentials | ||
MYSQL_USER="root" | ||
MYSQL_PASSWORD="root_secret_password" | ||
MYSQL_HOST="localhost" | ||
MYSQL_DATABASE="torrust_index_backend_e2e_testing" | ||
|
||
# Create the MySQL database for the index backend. Assumes MySQL client is installed. | ||
echo "Creating MySQL database $MYSQL_DATABASE for E2E testing ..." | ||
mysql -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD -e "DROP DATABASE IF EXISTS $MYSQL_DATABASE; CREATE DATABASE $MYSQL_DATABASE;" | ||
|
||
# Tracker | ||
|
||
# Delete tracker database | ||
rm -f ./storage/database/torrust_tracker_e2e_testing.db | ||
|
||
# Generate storage directory if it does not exist | ||
mkdir -p "./storage/database" | ||
|
||
# Generate the sqlite database for the tracker if it does not exist | ||
if ! [ -f "./storage/database/torrust_tracker_e2e_testing.db" ]; then | ||
touch ./storage/database/torrust_tracker_e2e_testing.db | ||
echo ";" | sqlite3 ./storage/database/torrust_tracker_e2e_testing.db | ||
fi | ||
|
||
./docker/bin/e2e/mysql/e2e-env-up.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
docker compose down | ||
./docker/bin/e2e/mysql/e2e-env-up.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
TORRUST_IDX_BACK_USER_UID=${TORRUST_IDX_BACK_USER_UID:-1000} \ | ||
docker compose build | ||
|
||
TORRUST_IDX_BACK_USER_UID=${TORRUST_IDX_BACK_USER_UID:-1000} \ | ||
TORRUST_IDX_BACK_CONFIG=$(cat config-idx-back.mysql.local.toml) \ | ||
TORRUST_IDX_BACK_MYSQL_DATABASE="torrust_index_backend_e2e_testing" \ | ||
TORRUST_TRACKER_CONFIG=$(cat config-tracker.local.toml) \ | ||
TORRUST_TRACKER_API_TOKEN=${TORRUST_TRACKER_API_TOKEN:-MyAccessToken} \ | ||
docker compose up -d | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
docker compose down | ||
./docker/bin/e2e/sqlite/e2e-env-up.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters