-
Notifications
You must be signed in to change notification settings - Fork 36
Test ManifestStore against S3 and fix key parsing #507
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5773879
Setup minio for testing S3 stores
maxrjones a826d66
Merge branch 'develop' into minio
maxrjones 1d1c875
Fix typing
maxrjones cee2cb9
Specify port
maxrjones 4d6a8f5
Run minio tests without pytest-xdist
maxrjones 8f9f0fd
Merge branch 'develop' into minio
maxrjones c12252e
Add WIP on obstore S3 tests
maxrjones f149885
Revert change to run-tests command
maxrjones 04d50d0
Separate env
maxrjones 6d63ab3
Update pytest marks
maxrjones ecd722f
Fix key manipulation
maxrjones 65f6374
Revert conftest changes
maxrjones 220fd50
Revert kerchunk test change
maxrjones cb566e6
mypy ignore MinIO
maxrjones 874c6df
Separate fixtures and add docstring
maxrjones 6a4cda4
Update pytest markers
maxrjones 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ jobs: | |
shell: bash -l {0} | ||
strategy: | ||
matrix: | ||
environment: [test-py311, test-py312, upstream, min-deps] | ||
environment: [test-py311, test-py312, upstream, min-deps, minio] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: prefix-dev/[email protected] | ||
|
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
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
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import time | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def container(): | ||
import docker | ||
|
||
client = docker.from_env() | ||
port = 9000 | ||
minio_container = client.containers.run( | ||
"quay.io/minio/minio", | ||
"server /data", | ||
detach=True, | ||
ports={f"{port}/tcp": port}, | ||
environment={ | ||
"MINIO_ACCESS_KEY": "minioadmin", | ||
"MINIO_SECRET_KEY": "minioadmin", | ||
}, | ||
) | ||
time.sleep(3) # give it time to boot | ||
# enter | ||
yield { | ||
"port": port, | ||
"endpoint": f"http://localhost:{port}", | ||
"username": "minioadmin", | ||
"password": "minioadmin", | ||
} | ||
# exit | ||
minio_container.stop() | ||
minio_container.remove() | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def minio_bucket(container): | ||
# Setup with guidance from https://medium.com/@sant1/using-minio-with-docker-and-python-cbbad397cb5d | ||
from minio import Minio | ||
|
||
bucket = "mybucket" | ||
filename = "test.nc" | ||
# Initialize MinIO client | ||
client = Minio( | ||
"localhost:9000", | ||
access_key=container["username"], | ||
secret_key=container["password"], | ||
secure=False, | ||
) | ||
client.make_bucket(bucket) | ||
yield { | ||
"port": container["port"], | ||
"endpoint": container["endpoint"], | ||
"username": container["username"], | ||
"password": container["password"], | ||
"bucket": bucket, | ||
"file": filename, | ||
"client": client, | ||
} |
Oops, something went wrong.
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.
This is the only non-test related change in the PR, which makes the ManifestStore work for both local and object stores