Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reestablish E2E Tests (reopened) #383

Merged

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Nov 14, 2023

The E2E test suite execution was not reestablished correctly here.

Some env vars were renamed (like TORRUST_INDEX_E2E_SHARED) so we were not running E2E tests (although they seemed to pass, we were only executing the ones that do not require a shared env).

This PR only reestablishes the E2E tests. There are a lot of pending refactors that will be done in new PRs like renaming env vars.

@codecov-commenter
Copy link

codecov-commenter commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (48ec4b1) 42.05% compared to head (d92443d) 42.05%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #383   +/-   ##
========================================
  Coverage    42.05%   42.05%           
========================================
  Files           79       79           
  Lines         4829     4829           
========================================
  Hits          2031     2031           
  Misses        2798     2798           

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

… tests

The SQLite file path inside the container is not the same as on hte
host:

In the container:

`sqlite:///var/lib/torrust/index/database/sqlite3.db?mode=rwc`

It's an absolute path.

From the host:

`sqlite://./storage/index/lib/database/sqlite3.db?mode=rwc`

It's a relative path to where the test are being executed (root project path).

TODO: inject as an env var when running the E2E tests isntead of parsing
the config file.

```
TORRUST_INDEX_E2E_SHARED=true TORRUST_INDEX_E2E_PATH_CONFIG="./share/default/config/index.container.sqlite3.toml" cargo test
```
…_id field

Some E2E tests were failing becuase a category field in a response was
renamed. I have reestablished the old name `category_id`.
until we reestablish the E2E tests.
The Tracker configuration was using MySQL instead of SQLite but the
database was not created. We can use SQLite for the Tracker even if in
this case we are testing with MySQL becuase E2E test are for the Index
not the tracker.
@josecelano josecelano linked an issue Nov 14, 2023 that may be closed by this pull request
@josecelano josecelano marked this pull request as ready for review November 14, 2023 17:36
@josecelano josecelano requested a review from a team as a code owner November 14, 2023 17:36
@josecelano
Copy link
Member Author

ACK 439ca84

@josecelano
Copy link
Member Author

Hi @da2ce7, I've made the minimum changes to reestablish E2E tests. I want to merge this asap so we have E2E tests enabled again.

Not all the old features have been re-established. There are some pending things like:

  • Use a different SQLite database for E2E tests to avoid overwriting the development one.
  • Remove unused ports from the Containerfile. Some ports were copied from the tracker.
  • Remove unused env vars like TORRUST_IDX_BACK_RUN_AS_USER, RUN_AS_USER
  • Rename env vars to follow conventions.
  • Review e2e-env-reset.sh scripts. The idea was to be able to run the E2E env and E2E test locally.
  • Remove duplicate function wait_for_container_to_be_healthy.
  • Add health checks for containers.
  • Inject DB connection info with env vars instead of using overwrite_sqlite_path and overwrite_mysql_host

I will create a new epic issue with a subtasks for each of those items.

@josecelano josecelano force-pushed the issue-342-reestablish-e2e-tests-reopen branch from 439ca84 to d92443d Compare November 14, 2023 17:46
@josecelano josecelano merged commit 7c0c86b into torrust:develop Nov 14, 2023
13 checks passed
@josecelano josecelano mentioned this pull request Nov 15, 2023
8 tasks
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.

Reestablish E2E Tests
2 participants