From 74bc161b2e950cb6c7be61c29d32679ebd84c5cd Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 21 Jan 2019 14:06:30 -0500 Subject: [PATCH] Add an additional validation test to the tag backfill worker tests --- workers/test/test_tagbackfillworker.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/workers/test/test_tagbackfillworker.py b/workers/test/test_tagbackfillworker.py index 6ee046b28..430cba3a8 100644 --- a/workers/test/test_tagbackfillworker.py +++ b/workers/test/test_tagbackfillworker.py @@ -111,6 +111,21 @@ def test_tagbackfillworker(clear_all_rows, initialized_db): assert len(tags) == len(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