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

[5.2] Fix Postgres Problem in our testing #44303

Draft
wants to merge 7 commits into
base: 5.2-dev
Choose a base branch
from

Conversation

rdeutz
Copy link
Contributor

@rdeutz rdeutz commented Oct 18, 2024

Summary of Changes

Clean up the data in a different way.

@rdeutz rdeutz changed the title [5.2] Fix Postgreas Problem in out testing [5.2] Fix Postgreas Problem in our testing Oct 18, 2024
@rdeutz rdeutz marked this pull request as draft October 18, 2024 08:03
@rdeutz rdeutz changed the title [5.2] Fix Postgreas Problem in our testing [5.2] Fix Postgres Problem in our testing Oct 18, 2024
@muhme
Copy link
Contributor

muhme commented Oct 18, 2024

From my point of view, it would be more beneficial to perform the cleanup in beforeEach rather than in afterEach. This prevents tests from failing after they are interrupted and avoids requiring the installation step. This change should be applied consistently across all tests, either by cleaning up all test-created database objects or using transactions. I like to discuss this further with @laoneo and @alikon.

Regarding the failing System Tests with the error duplicate key value violates unique constraint "_users_pkey" with PostgreSQL, from my point of view it is related to cleanupDB() is not completed before the next test run creates a new user and needs to be fixed on chaining and I'am working on resolving it.

@rdeutz
Copy link
Contributor Author

rdeutz commented Oct 18, 2024

From my point of view, it would be more beneficial to perform the cleanup in beforeEach rather than in afterEach. This prevents tests from failing after they are interrupted and avoids requiring the installation step. This change should be applied consistently across all tests, either by cleaning up all test-created database objects or using transactions. I like to discuss this further with @laoneo and @alikon.

Makes sense

Regarding the failing System Tests with the error duplicate key value violates unique constraint "_users_pkey" with PostgreSQL, from my point of view it is related to cleanupDB() is not completed before the next test run creates a new user and needs to be fixed on chaining and I'am working on resolving it.

The cleanupDB is a good idea, haven't looked at the test for a longer time and didn't noticed this. But as far as I understand it it runs only after a block and not after a single test. So my guess is that this will not help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants