microbiomedata/nmdc-runtime

`berkeley`: Fix test failing due to Biosample JSON data being invalid

Closed this issue · 1 comments

The test tests/test_api/test_endpoints.py::test_submit_changesheet is failing on the berkeley branch.

Here's what pytest shows about the failure:

E           fastapi.exceptions.HTTPException: 422: {'update_cmd': {'nmdc:bsm-12-7mysck21': {'update': 'biosample_set', 'updates': [{'q': {'id': 'nmdc:bsm-12-7mysck21'}, 'u': {'$set': {'part_of': ['nmdc:sty-11-pzmd0x14']}}}]}}, 'validation_errors': [["Additional properties are not allowed ('part_of' was unexpected)", "'type' is a required property", "'type' is a required property", "{'id': 'ENVO:01000253', 'name': 'freshwater river biome'} is not valid under any of the given schemas", "'type' is a required property", "{'id': 'ENVO:03600095', 'name': 'stream run'} is not valid under any of the given schemas", "'type' is a required property", "{'id': 'ENVO:01001057', 'name': 'environment associated with a plant part or small plant'} is not valid under any of the given schemas", "'type' is a required property", "'type' is a required property", "'type' is a required property", "'associated_studies' is a required property"]]}

part_of needs to be replaced with associated_studies. Do you want me to do this in the berkeley branch you have?