From b6b9b38a340bec49006e9c007c36b04e75c03a71 Mon Sep 17 00:00:00 2001 From: Billy Zha Date: Thu, 25 Jan 2024 06:37:59 +0000 Subject: [PATCH] add e2e for discover Signed-off-by: Billy Zha --- test/e2e/suite/command/discover.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/e2e/suite/command/discover.go b/test/e2e/suite/command/discover.go index 8f455b965..0b3d782ae 100644 --- a/test/e2e/suite/command/discover.go +++ b/test/e2e/suite/command/discover.go @@ -178,12 +178,18 @@ var _ = Describe("1.1 registry users:", func() { It("should all referrers of a subject", func() { referrers := []ocispec.Descriptor{foobar.SBOMImageReferrer, foobar.SBOMImageReferrer} err := ORAS("discover", subjectRef, "--format", format). - MatchErrKeyWords(feature.Deprecated.Mark). MatchKeyWords(append(discoverKeyWords(false, referrers...), foobar.Digest)...). Exec().Err Expect(err).NotTo(gbytes.Say(feature.Deprecated.Mark)) }) }) + When("running discover command with go-template output", Focus, func() { + It("should show referrers digest of a subject", func() { + ORAS("discover", subjectRef, "--format", "{{(first .Manifests).Ref}}"). + MatchContent(RegistryRef(ZOTHost, ArtifactRepo, foobar.SBOMImageReferrer.Digest.String())). + Exec() + }) + }) }) var _ = Describe("1.0 registry users:", func() {