Skip to content

Inject E2E DB connection info with environent variable#403

Merged
josecelano merged 1 commit intotorrust:developfrom
josecelano:issue-390-inject-db-connection-info-for-e2e-tests
Nov 22, 2023
Merged

Inject E2E DB connection info with environent variable#403
josecelano merged 1 commit intotorrust:developfrom
josecelano:issue-390-inject-db-connection-info-for-e2e-tests

Conversation

@josecelano
Copy link
Copy Markdown
Member

How to run E2E tests example:

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 \
    || exit 1

The new TORRUST_INDEX_E2E_DB_CONNECT_URL is used to connect to the E2E DB directly. IT's needed for some tests to set the initial state needed for the test, when it's not possible do do it otherwise.

```
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 \
    || exit 1
```

Th new `TORRUST_INDEX_E2E_DB_CONNECT_URL` is used to connect to the E2E
DB directly. IT's needed for some tests to setthe initial state needed
for the test, when it's not possible do do it otherwise.
@josecelano josecelano linked an issue Nov 22, 2023 that may be closed by this pull request
@josecelano josecelano requested a review from da2ce7 November 22, 2023 19:02
@josecelano
Copy link
Copy Markdown
Member Author

ACK 1b33145

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c17ebbd) 42.27% compared to head (1b33145) 42.27%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #403   +/-   ##
========================================
  Coverage    42.27%   42.27%           
========================================
  Files           80       80           
  Lines         4887     4887           
========================================
  Hits          2066     2066           
  Misses        2821     2821           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josecelano josecelano merged commit dbf02c4 into torrust:develop Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Inject DB connection info for E2E tests

2 participants