From 22053f57b0580cb8eedbb105440aa625f0afdc7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= <484633+joaodrp@users.noreply.github.com> Date: Thu, 27 May 2021 23:51:55 +0100 Subject: [PATCH] Fix listener tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Pereira <484633+joaodrp@users.noreply.github.com> --- notifications/listener_test.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/notifications/listener_test.go b/notifications/listener_test.go index 74439668..e34707d7 100644 --- a/notifications/listener_test.go +++ b/notifications/listener_test.go @@ -199,11 +199,20 @@ func checkExerciseRepository(t *testing.T, repository distribution.Repository, r t.Fatalf("mismatching digest from payload and put") } + if err := repository.Tags(ctx).Tag(ctx, tag, distribution.Descriptor{Digest: dgst}); err != nil { + t.Fatalf("unexpected error tagging manifest: %v", err) + } + _, err = manifests.Get(ctx, dgst) if err != nil { t.Fatalf("unexpected error fetching manifest: %v", err) } + err = repository.Tags(ctx).Untag(ctx, m.Tag) + if err != nil { + t.Fatalf("unexpected error deleting tag: %v", err) + } + err = manifests.Delete(ctx, dgst) if err != nil { t.Fatalf("unexpected error deleting blob: %v", err) @@ -216,11 +225,6 @@ func checkExerciseRepository(t *testing.T, repository distribution.Repository, r } } - err = repository.Tags(ctx).Untag(ctx, m.Tag) - if err != nil { - t.Fatalf("unexpected error deleting tag: %v", err) - } - err = remover.Remove(ctx, repository.Named()) if err != nil { t.Fatalf("unexpected error deleting repo: %v", err)