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

Tests: Fix database cleaner separation #676

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

Splines
Copy link
Member

@Splines Splines commented Aug 13, 2024

In #647, we noticed that our unit tests were failing in the pipeline (GitHub Actions). We noticed locally that the database is not fully cleaned and there are users left between tests. We now use the slower deletion strategy which will entirely delete the tables since transactions was not working for us. This might be due to after_commitor after_save callbacks as discussed here.

Note that for the deletion strategy, we also tried out to set pre_count and reset_ids to true as described here, but this made the tests slower, so we will omit those options.

For a discussion on delete vs. truncate, see this StackOverflow answer.

Note that this PR was opened after a long night session were Denis and I both tried to dig down deep. We hope this PR doesn't break anything 😅 But it shouldn't and if it does, then only our tests.

@Splines Splines added the tests Unit tests, integration tests etc. label Aug 13, 2024
@Splines Splines requested a review from fosterfarrell9 August 13, 2024 21:13
@Splines Splines self-assigned this Aug 13, 2024
@Splines Splines merged commit 6557bf4 into dev Aug 13, 2024
5 checks passed
@Splines Splines deleted the tests/fix-database-cleaner-separation branch August 13, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Unit tests, integration tests etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants