-
Notifications
You must be signed in to change notification settings - Fork 330
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
Fix upload snowball objects with staging file #1286
Merged
harshavardhana
merged 6 commits into
minio:master
from
emrocha:fix_upload_snowball_objects_with_staging_file
Aug 17, 2023
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d2295d0
Fix upload_snowball_objects with staging_filename option
emrocha 6327fa5
Add test toupload_snowball_objects with staging file
emrocha e7b2e23
Split test test_upload_snowball_objects_with_staging
emrocha 6052253
Remove duplicated code
emrocha 3631a46
Add pylint: disable=invalid-name
emrocha 2b6c3c9
adjustments for lint
emrocha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1891,6 +1891,32 @@ def test_upload_snowball_objects(log_entry): | |
_CLIENT.remove_object(bucket_name, "my-object3") | ||
_CLIENT.remove_bucket(bucket_name) | ||
|
||
# run with staging file option | ||
try: | ||
_CLIENT.make_bucket(bucket_name) | ||
size = 3 * MB | ||
reader1 = LimitedRandomReader(size) | ||
reader2 = LimitedRandomReader(size) | ||
_CLIENT.upload_snowball_objects( | ||
bucket_name, | ||
[ | ||
SnowballObject("my-object1", data=io.BytesIO(b"py"), length=2), | ||
SnowballObject( | ||
"my-object2", data=reader1, length=size, | ||
), | ||
SnowballObject( | ||
"my-object3", data=reader2, length=size, | ||
mod_time=datetime.now(), | ||
), | ||
], | ||
staging_filename="staging.tar" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use random filename here like |
||
) | ||
_test_list_objects_api(bucket_name, 3) | ||
finally: | ||
_CLIENT.remove_object(bucket_name, "my-object1") | ||
_CLIENT.remove_object(bucket_name, "my-object2") | ||
_CLIENT.remove_object(bucket_name, "my-object3") | ||
_CLIENT.remove_bucket(bucket_name) | ||
|
||
def main(): | ||
""" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have
def _test_upload_snowball_objects(log_entry, staging_filename):
and use the method to have two tests namedtest_upload_snowball_objects()
andtest_upload_snowball_objects_staging_file
to avoid code duplication.