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

Rewrite integration tests to use a persistent bucket #364

Conversation

jakub-cichalewski-reef
Copy link

No description provided.

@jakub-cichalewski-reef jakub-cichalewski-reef marked this pull request as draft April 19, 2024 01:07
Copy link

@vbaltrusaitis-reef vbaltrusaitis-reef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments within code. But the main comment is not about a specific piece of code here. The goal of this task is to minimize bucket creation where it's not necessary for the test functionality. Now, test_raw_api does have two calls that create buckets. However, this is not the only or even main source of bucket creation: tests in test_download.py, test_file_version_attributes.py, test_upload.py create even more buckets.


def raw_api_test_helper(raw_api, should_cleanup_old_buckets):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, you're refactoring raw_api_test_helper() . It's one big linear function calling most raw_api endpoints in one go, you're splitting it into methods of a test class. I wouldn't necessarily mind this refactor in general, but it seems quite orthogonal to the issue at hand, which is creating less buckets in testing. I'd much prefer such refactor be done in a separate commit or even PR. Here, it would be enough to pass in a fixture that allows getting a dir in a bucket and cleans up afterwards.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right that this refactor could be a different PR. I decided I wanted to have a clear split between bucket and non-bucket tests, and since this way of splitting makes more sense in the context of what is done in this PR (this refactor prob wouldn't have been done otherwise), I decided to do it here. At the end of this PR I'll rebase my commits and have a separate commit for this refactor.

Comment on lines 79 to 80
'readBucketNotifications',
'writeBucketNotifications',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect I know why you removed those, this is just a reminder that they will need to be added back here at some point.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I re-added these lines and marked test.integration.test_bucket.test_bucket_notification_rules to be skipped - since the API for these notifications is disabled this test should not be necessary and won't run (unless I'm missing something?)

@jakub-cichalewski-reef jakub-cichalewski-reef force-pushed the integration_test_reuse_buckets branch 2 times, most recently from 7d2f812 to 6ffefec Compare May 7, 2024 01:12
@jakub-cichalewski-reef jakub-cichalewski-reef force-pushed the integration_test_reuse_buckets branch from 6ffefec to 68b2af6 Compare May 7, 2024 01:13
@jakub-cichalewski-reef jakub-cichalewski-reef marked this pull request as ready for review May 7, 2024 16:22
@jakub-cichalewski-reef jakub-cichalewski-reef force-pushed the integration_test_reuse_buckets branch 3 times, most recently from 1ca7c66 to 06ed8ae Compare May 8, 2024 01:10
@jakub-cichalewski-reef jakub-cichalewski-reef force-pushed the integration_test_reuse_buckets branch from 6c04318 to 2844b63 Compare May 8, 2024 01:25
@jakub-cichalewski-reef jakub-cichalewski-reef changed the title Change non-bucket raw api integration tests to using a persistent bucket Rewrite integration tests to use a persistent bucket May 8, 2024
@jakub-cichalewski-reef
Copy link
Author

succesful Actions run here
Comparing test run times to some other actions in this (reef) repo, after rewrite 10-30 s speed increase can be observed.
One more thing to check is automatic cleanup inside a bucket which I'll observe later today.

@mjurbanski-reef
Copy link

replaced by #379

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

Successfully merging this pull request may close these issues.

3 participants