-
Notifications
You must be signed in to change notification settings - Fork 12
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
New AssetPaths lead to dandi-cli integration testing failing #1336
Comments
I seem to get this error on dandi/dandi-cli#1104 (PR against dandi-cli master, as described here). There are indeed 10 test failures, but only 9 are Example traceback:
The different error is an AssertionError at the test level, i.e. the process succeeds but not with the expected output:
|
I can confirm that the tests are failing when run locally. Here is a gist of the logs from the Django container during a complete test run; grep it for errors. All the failures seem to boil down to one of two API calls: deleting a Zarr and modifying the asset metadata for a Zarr. MVCEs for FailuresDeleting a Zarr(Note: This script originally tried to clean up afterwards by deleting the Dandiset, but that failed with 500 as well.) import logging
import os
from pathlib import Path
import tempfile
from dandi.dandiapi import DandiAPIClient
from dandi.files import dandi_file
import numpy as np
import zarr
logging.basicConfig(
format="%(asctime)s [%(levelname)-8s] %(name)s: %(message)s",
datefmt="%H:%M:%S",
level=logging.DEBUG,
)
with DandiAPIClient.for_dandi_instance(
"dandi-staging", token=os.environ["DANDI_API_KEY"]
) as client:
d = client.create_dandiset(
"Dandiset with an empty Zarr",
{
"schemaKey": "Dandiset",
"name": "Test Dandiset",
"description": "A test Dandiset",
"contributor": [
{
"schemaKey": "Person",
"name": "Wodder, John",
"roleName": ["dcite:Author", "dcite:ContactPerson"],
}
],
"license": ["spdx:CC0-1.0"],
},
)
dandiset_id = d.identifier
print("DANDISET ID:", dandiset_id)
with tempfile.TemporaryDirectory() as tmpdir:
filepath = Path(tmpdir, "example.zarr")
zarr.save(filepath, np.arange(1000), np.arange(1000, 0, -1))
zf = dandi_file(filepath)
asset = zf.upload(d, {"description": "A test Zarr"})
asset.delete() Modifying a Zarr's metadataimport logging
import os
from pathlib import Path
import tempfile
from dandi.dandiapi import DandiAPIClient
from dandi.files import dandi_file
import numpy as np
import zarr
logging.basicConfig(
format="%(asctime)s [%(levelname)-8s] %(name)s: %(message)s",
datefmt="%H:%M:%S",
level=logging.DEBUG,
)
log = logging.getLogger()
with DandiAPIClient.for_dandi_instance(
"dandi-staging", token=os.environ["DANDI_API_KEY"]
) as client:
d = client.create_dandiset(
"Dandiset with an empty Zarr",
{
"schemaKey": "Dandiset",
"name": "Test Dandiset",
"description": "A test Dandiset",
"contributor": [
{
"schemaKey": "Person",
"name": "Wodder, John",
"roleName": ["dcite:Author", "dcite:ContactPerson"],
}
],
"license": ["spdx:CC0-1.0"],
},
)
dandiset_id = d.identifier
log.info("*** Dandiset ID: %s", dandiset_id)
with tempfile.TemporaryDirectory() as tmpdir:
filepath = Path(tmpdir, "example.zarr")
zarr.save(filepath, np.arange(1000), np.arange(1000, 0, -1))
zf = dandi_file(filepath)
asset = zf.upload(d, {"description": "A test Zarr"})
md = asset.get_raw_metadata()
md["description"] = "modified"
log.info("*** Modifying asset metadata ...")
asset.set_raw_metadata(md) |
Thanks for all of the info, I've determined the issue. I'll be making a pull request to fix it soon, detailing the cause there. |
@jwodder did you figure out why the integration testing did not fail in that PR and started to fail only after being merged? |
@yarikoptic I think it's the fault of dandi/dandi-cli#1121; because the dandi-cli tests now pull the latest image from Docker Hub, the integration tests don't use the image built from the PR code. |
Nice digging, sounds like the likely cause. I guess let's do dandi/dandi-cli#1140 and then use it in the workflow here to disable that pulling. |
🚀 Issue was released in |
Merging #1312 seems has lead to failing testing against dandi-cli in master
The text was updated successfully, but these errors were encountered: