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

Allow check_upload assets to use docker #323

Merged
merged 2 commits into from
Aug 23, 2024
Merged

Conversation

shoeffner
Copy link
Contributor

The docker compose setup as used in pyDataverse uses a different storage backend than demo.dataverse.org, so the storageIdentifier reports a non-s3:// address.

This commit detects the two most common ways of specifying localhost (leaving out 127.1 and the like) to allow for local:// storageIdentifiers.

Relates to #320.

The docker compose setup as used in pyDataverse uses a different storage
backend than demo.dataverse.org, so the storageIdentifier reports
a non-s3:// address.

This commit detects the two most common ways of specifying localhost
(leaving out 127.1 and the like) to allow for `local://` storageIdentifiers.

Relates to datalad#320.
@@ -140,7 +141,12 @@ def check_upload(api, dsid, fcontent, fpath, src_md5):
# TODO: seemingly discontinued between Dataverse 5.13 and 6.0?
#assert df['pidURL'] == ''
assert df['rootDataFileId'] == -1
assert df['storageIdentifier'].startswith('s3://demo-dataverse')

dv_url = os.getenv('DATAVERSE_TEST_BASEURL')
Copy link
Member

Choose a reason for hiding this comment

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

We have a test fixture that provides this if it is defined in the environment, and falls back on the demo instance if not:

def dataverse_instance_url(dataverse_demoinstance_url):
# use a custom instance if declared, otherwise fall back on
# standard demo instance
return environ.get("DATAVERSE_TEST_BASEURL",
dataverse_demoinstance_url)

I'll push a change into this PR.

@adswa adswa merged commit bf402b8 into datalad:main Aug 23, 2024
4 of 5 checks passed
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