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

Reuse containers in tests #1300

Closed
provokateurin opened this issue Dec 14, 2023 · 2 comments · Fixed by #1326
Closed

Reuse containers in tests #1300

provokateurin opened this issue Dec 14, 2023 · 2 comments · Fixed by #1326
Assignees
Labels
package: nextcloud refactoring Something that needs to be refactored

Comments

@provokateurin
Copy link
Member

Currently we spawn a new container for every single test to ensure a clean state and no side effects. This slows down our tests because significant time is spent on spawning the containers.
It should be possible to migrate some of the tests to share containers. It is not possible to do this everywhere but we are also not forced to share them everywhere.
I hope this will especially boost the performance of the news tests as they are our slowest right now and I think a lot of that has to do with re-fetching the feeds in every test which slows them down massively.

@provokateurin provokateurin added package: nextcloud refactoring Something that needs to be refactored labels Dec 14, 2023
@provokateurin provokateurin self-assigned this Dec 14, 2023
@provokateurin
Copy link
Member Author

I haven't migrated all tests yet, but there already is a huge speed benefit. The tests mostly execute as fast as normal unit tests would. Haven't checked news yet, but I'm sure it will be way more performant.

@provokateurin
Copy link
Member Author

I'm using random shuffling of the tests to find problems and we might want to do this in the CI as well with a new random seed every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: nextcloud refactoring Something that needs to be refactored
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant