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

Big objects #51

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Big objects #51

wants to merge 12 commits into from

Conversation

2xlhe
Copy link
Collaborator

@2xlhe 2xlhe commented Jan 23, 2025

No description provided.


# Generate Files
/tmp_files/*
Copy link
Collaborator

Choose a reason for hiding this comment

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

o que vc acha de usar o path /tmp do próprio linux? ao invés de uma pasta local no projeto.


@pytest.mark.slow
@pytest.mark.big_objects
def test_multipart_download(s3_client, fixture_bucket_with_name, fixture_upload_multipart_file, params):
Copy link
Collaborator

Choose a reason for hiding this comment

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

vamos fazer este teste ser executável via jupyter notebook? acho que da para pegar o exemplo de como estão outros, mas posso te mostrar na reunião também

# The test was successful only if the size on the bucket size is equal to the ones uploaded and downloaded
assert downloaded_file_size == uploaded_file_size, f"Downloaded size doesn't match: {downloaded_file_size} with Upload size: {uploaded_file_size}"
except Exception as e:
logging.error(f"Error uploading object {object_key}: {e}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

acho que é downloading nesta msg né?

@@ -0,0 +1,88 @@
import pytest
import logging
from utils.utils import create_big_file, convert_unit
Copy link
Collaborator

Choose a reason for hiding this comment

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

acho que convert_unit não é usada neste arquivo


@pytest.mark.parametrize(
'params, fixture_upload_multipart_file',
[(p, p) for p in upload_params],
Copy link
Collaborator

Choose a reason for hiding this comment

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

voce passa os mesmos parametros tanto para a fixture (indirect) quanto para o teste, que usa a fixture. Será que não daria para usar só a fixture? Faz ela retornar as 3 coisas (path, size, key) ao inves de somente o size

Test to download a big object to an S3 bucket using multipart download
:param s3_client: fixture of boto3 s3 client
:param fixture_bucket_with_name: fixture to create a bucket with a unique name
:param params: dict: 'file_path': str, 'file_size': dict, 'object_key': str
Copy link
Collaborator

Choose a reason for hiding this comment

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

nao esquece de ajustar aqui caso aceite a sugestão anterior

# Checking if the object was uploaded
object_size = s3_client.get_object(Bucket=bucket_name, Key=object_key).get('ContentLength', 0)

return object_size #return int of size in bytes
Copy link
Collaborator

Choose a reason for hiding this comment

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

aqui o que eu comentei de retornar os 3 dados

@fczuardi
Copy link
Collaborator

fczuardi commented Feb 7, 2025

precisa de um rebase

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.

2 participants