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

Finalize Azure Transfer tests #1051

Merged
merged 204 commits into from
Jun 11, 2024
Merged

Conversation

gcglinton
Copy link
Contributor

@gcglinton gcglinton commented May 16, 2024

Managed to write the last few tests for the Azure Transfer driver, using Testcontainers, specifically the Azurite one.

It spins up a container for every test function in the file, and then destroys it, so the state is clean, and well defined between tests.

It takes quite a long time to run, compared to the S3 tests, or any others, because it's having to do a lot of work in the background for each test. It might be possible to optimize things, but using different "containers" (in Azurite, not a Docker container), re-using the same Testcontainer, but that would need a bit more work to setup for each test.

edit: Going to see if that last idea is viable...

Copy link

github-actions bot commented May 16, 2024

Test Results

243 tests   242 ✅  1m 4s ⏱️
  1 suites    1 💤
  1 files      0 ❌

Results for commit d1d4ed7.

♻️ This comment has been updated with latest results.

petersilva and others added 2 commits May 15, 2024 23:39
Was previously spinning up/down Docker containers for each test, now it only creates one, but uses a different storage account "container" for each test. Way faster this way.
Also, fixed a warning in test_rmdir from using blob, instead of blob.name.
@gcglinton
Copy link
Contributor Author

Was able to re-work the tests per my last paragraph.

It now only creates a single instance of Azurite for the whole test module.

Each test function then creates it's own storage container (in Azurite, not a docker container), and creates the same blobs, so that the environment is uniform across tests.

It took the runtime down from 2m40s, to just around 1 minute.

@gcglinton gcglinton marked this pull request as ready for review May 16, 2024 12:36
@gcglinton
Copy link
Contributor Author

Closes #1015, and related to #1016.

@petersilva
Copy link
Contributor

So... I checked out the branch, and merged from development, and pip3 install -r requirements.txt, and it fails very long...

The summary is:

tests/sarracenia/transfer/azure_test.py ......FEE..E.E.EE.  

the very long complaints are lots of occurrences of:


../../.local/lib/python3.10/site-packages/urllib3/connectionpool.py:703: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../.local/lib/python3.10/site-packages/urllib3/connectionpool.py:398: in _make_request
    conn.request(method, url, **httplib_request_kw)
../../.local/lib/python3.10/site-packages/urllib3/connection.py:239: in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
/usr/lib/python3.10/http/client.py:1283: in request
    self._send_request(method, url, body, headers, encode_chunked)
/usr/lib/python3.10/http/client.py:1329: in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
/usr/lib/python3.10/http/client.py:1278: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/usr/lib/python3.10/http/client.py:1038: in _send_output
    self.send(msg)
/usr/lib/python3.10/http/client.py:976: in send
    self.connect()

other occurrences of:

E           requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

../../.local/lib/python3.10/site-packages/requests/adapters.py:501: ConnectionError

        ) from e

E docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

../../.local/lib/python3.10/site-packages/docker/api/client.py:230: DockerException


E FileNotFoundError: [Errno 2] No such file or directory

../../.local/lib/python3.10/site-packages/docker/transport/unixconn.py:26: FileNotFoundError


what file is missing where is the question I guess.  running this on ubuntu 22.04.

Found while adding remaining unit tests
Using the Azureite testcontainers to build a local dummy instance of Azure Storage accounts.
There's a slightly hacky fix for the rmdir method, as documented.
Was previously spinning up/down Docker containers for each test, now it only creates one, but uses a different storage account "container" for each test. Way faster this way.
Also, fixed a warning in test_rmdir from using blob, instead of blob.name.
Copy link
Contributor

@petersilva petersilva left a comment

Choose a reason for hiding this comment

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

works better with docker installed ;-)

@petersilva petersilva merged commit 6b46501 into development Jun 11, 2024
4 checks passed
@petersilva petersilva deleted the FinalizeAzureTransferTests branch June 19, 2024 12:49
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.

5 participants