swh_indexer_config = {'compute_checksums': ['blake2b512'], 'indexer_storage': {'cls': 'local', 'db': "user=postgres password=xxx dbname=tes...cheduler': {'cls': 'local', 'db': "user=postgres password=xxx dbname=tests host=127.0.0.1 port=12357 options=''"}, ...}
idx_storage = <swh.indexer.storage.IndexerStorage object at 0x7f922ad90780>
storage = <swh.storage.postgresql.storage.Storage object at 0x7f922ad482b0>
obj_storage = <swh.objstorage.backends.in_memory.InMemoryObjStorage object at 0x7f922adb30f0>
def test_origin_metadata_indexer_partial_missing_head(
swh_indexer_config,
idx_storage: IndexerStorageInterface,
storage: StorageInterface,
obj_storage,
) -> None:
origin1 = "https://example.com"
origin2 = "https://github.com/librariesio/yarn-parser"
storage.origin_add([Origin(url=origin1)])
indexer = OriginMetadataIndexer(config=swh_indexer_config)
indexer.run([origin1, origin2])
dir_id = DIRECTORY2.id
dir_results = list(indexer.idx_storage.directory_intrinsic_metadata_get([dir_id]))
> assert dir_results == [
DirectoryIntrinsicMetadataRow(
id=dir_id,
metadata=YARN_PARSER_METADATA,
mappings=["npm"],
tool=dir_results[0].tool,
)
]
E AssertionError: assert [DirectoryInt...ings=['npm'])] == [DirectoryInt...ings=['npm'])]
E At index 0 diff: DirectoryIntrinsicMetadataRow(indexer_configuration_id=None, tool={'id': 1, 'name': 'swh-metadata-translator', 'version': '0.0.2', 'configuration': {'type': 'local', 'context': 'NpmMapping'}}, id=b'aE\xaaST\x9d2\xe2uC\xb8(\x1a?\xb2\xdbbW\xf6\xfe', metadata={'url': 'https://github.com/librariesio/yarn-parser#readme', 'name': 'yarn-parser', 'type': 'SoftwareSourceCode', 'author': [{'name': 'Andrew Nesbitt', 'type': 'Person'}], 'license': 'https://spdx.org/licenses/AGPL-3.0', 'version': '1.0.0', '@context': 'https://doi.org/10.5063/schema/codemeta-2.0', 'k...
E
E ...Full output truncated (4 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/indexer/tests/test_origin_metadata.py:167: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Aug 22 2022, 3:21 PM