Add an additional validation test to the tag backfill worker tests

This commit is contained in:
Joseph Schorr 2019-01-21 14:06:30 -05:00
parent 171e2ec39b
commit 74bc161b2e

View file

@ -111,6 +111,21 @@ def test_tagbackfillworker(clear_all_rows, initialized_db):
assert len(tags) == len(oci_tags) assert len(tags) == len(oci_tags)
assert {t.name for t in tags} == {t.name for t in oci_tags} assert {t.name for t in tags} == {t.name for t in oci_tags}
for tag in tags:
tag_manifest = TagManifest.get(tag=tag)
ttr = TagToRepositoryTag.get(repository_tag=tag)
manifest = ttr.tag.manifest
assert tag_manifest.json_data == manifest.manifest_bytes
assert tag_manifest.digest == manifest.digest
assert tag.image == ManifestLegacyImage.get(manifest=manifest).image
assert tag.lifetime_start_ts == (ttr.tag.lifetime_start_ms / 1000)
if tag.lifetime_end_ts:
assert tag.lifetime_end_ts == (ttr.tag.lifetime_end_ms / 1000)
else:
assert ttr.tag.lifetime_end_ms is None
assert found_dead_tag assert found_dead_tag