-
Notifications
You must be signed in to change notification settings - Fork 11
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
improve help options #60
Conversation
Codecov Report
@@ Coverage Diff @@
## master #60 +/- ##
==========================================
+ Coverage 96.07% 96.14% +0.07%
==========================================
Files 13 13
Lines 1274 1298 +24
==========================================
+ Hits 1224 1248 +24
Misses 50 50
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
see comments above
Co-authored-by: Yaroslav Halchenko <[email protected]>
so we have two failing tests in dandi-cli
test_publish_and_manipulate_________________________ test_publish_and_manipulate __________________________
local_dandi_api = {'api_key': 'XXX', 'client': <dandi.dandiapi.DandiAPIClient object at 0x7fd3f60f3...di_instance(gui=None, redirector=None, api='http://localhost:8000/api'), 'instance_id': 'dandi-api-local-docker-tests'}
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fd3f60f3c40>
tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_publish_and_manipulate0')
def test_publish_and_manipulate(local_dandi_api, monkeypatch, tmp_path):
client = local_dandi_api["client"]
d = client.create_dandiset(
"Test Dandiset",
{
"schemaKey": "Dandiset",
"name": "Text Dandiset",
"description": "A test text Dandiset",
"contributor": [
{
"schemaKey": "Person",
"name": "Wodder, John",
"roleName": ["dcite:Author", "dcite:ContactPerson"],
}
],
"license": ["spdx:CC0-1.0"],
"manifestLocation": ["https://github.com/dandi/dandi-cli"],
},
)
dandiset_id = d.identifier
upload_dir = tmp_path / "upload"
upload_dir.mkdir()
(upload_dir / dandiset_metadata_file).write_text(f"identifier: '{dandiset_id}'\n")
(upload_dir / "subdir").mkdir()
(upload_dir / "subdir" / "file.txt").write_text("This is test text.\n")
monkeypatch.chdir(upload_dir)
monkeypatch.setenv("DANDI_API_KEY", local_dandi_api["api_key"])
upload(
paths=[],
dandi_instance=local_dandi_api["instance_id"],
devel_debug=True,
allow_any_path=True,
validation="skip",
)
> d.wait_until_valid()
/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/dandi/tests/test_dandiapi.py:67:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = RemoteDandiset(client=<dandi.dandiapi.DandiAPIClient object at 0x7fd3f60f3f10>, identifier='000002', created=datetime....nfo=datetime.timezone.utc), modified=datetime.datetime(2021, 7, 20, 18, 56, 42, 880758, tzinfo=datetime.timezone.utc)))
min_time = 20
def wait_until_valid(self, min_time=20):
"""
Wait for a Dandiset to be valid. Validation is a background celery
task which runs asynchronously, so we need to wait for it to complete.
"""
lgr.debug("Waiting for Dandiset %s to complete validation ...", self.identifier)
start = time()
while time() - start < min_time:
r = self.client.get(f"{self.version_api_path}info/")
if "status" not in r:
# Running against older version of dandi-api that doesn't
# validate
return
if r["status"] == "Valid":
return
sleep(0.5)
> raise ValueError(
f"Dandiset {self.identifier} is {r['status']}: {r['validation_error']}"
)
E ValueError: Dandiset 000002 is Invalid: Metadata version 0.5.0 is not allowed. Allowed are: 0.4.4.
/opt/hostedtoolcache/Python/3.8.11/x64/lib/python3.8/site-packages/dandi/dandiapi.py:448: ValueError
test_download_newest_version upon `/publish/`
what I am thinking -- may be for the purpose of the tests here |
* upstream/master: Test ETagHashlike Copy dandietag code from dandi-cli
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.
some comments/summary from discussion
* upstream/master: RF(CI): run dandi-cli tests only against 3.8 (but all OSes) Docker image needs git to build Run dandi-cli tests with dandi-api image built with local version of dandischema
@yarikoptic - this should be ok now even for the gui. take a look at the last commit and the overall merge. we need to remove the patch/release from PR #65 |
Co-authored-by: Yaroslav Halchenko <[email protected]>
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.
Left some suggestions and primarily a question about schema_extra
-- some documentation + comments and ideally some kind of a test seems would be very benefitial.
still need to fix importing re. will do that in client Co-authored-by: Yaroslav Halchenko <[email protected]>
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.
just nit picking on descriptions - should we unify to avoid the "subject of the matter" or at least harmonize the "subject" in *Asset's?
Co-authored-by: Yaroslav Halchenko <[email protected]>
Co-authored-by: Yaroslav Halchenko <[email protected]>
looks like all tests are passing. the two failing checks are on released cli which does not include the docker-compose fix merged today. |
eh, I hoped to release dandi-cli with dandi/dandi-cli#743 but testing just got stuck there -- never saw such to happen. but i guess we should just delay release until we also boost for new dandischema as soon that is what dandi-api starts to use. |
This PR improves several of the items that show up in the metadata editor and elsewhere.