Skip to content

Commit

Permalink
fixed failed test
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
  • Loading branch information
wangxiaoxuan273 committed Jan 15, 2024
1 parent 0b5e9cc commit 47606e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/e2e/suite/command/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ var _ = Describe("ORAS beginners:", func() {
})

It("should fail with suggestion if no tag or digest is provided", func() {
ORAS("manifest", "fetch", RegistryRef(ZOTHost, ImageRepo, "")).ExpectFailure().MatchErrKeyWords("Error:", "no tag or digest specified", "oras manifest fetch [flags] <name>{:<tag>|@<digest>}", "You need to specify a reference").Exec()
ORAS("manifest", "fetch", RegistryRef(ZOTHost, ImageRepo, "")).ExpectFailure().MatchErrKeyWords("Error:", "no tag or digest specified", "oras manifest fetch [flags] <name>{:<tag>|@<digest>}", "Please specify a reference").Exec()
})
})

Expand Down Expand Up @@ -161,7 +161,7 @@ var _ = Describe("ORAS beginners:", func() {
It("should fail if no digest provided", func() {
dstRepo := fmt.Sprintf(repoFmt, "delete", "no-reference")
prepare(RegistryRef(ZOTHost, ImageRepo, foobar.Tag), RegistryRef(ZOTHost, dstRepo, ""))
ORAS("manifest", "delete", RegistryRef(ZOTHost, dstRepo, "")).ExpectFailure().MatchErrKeyWords("Error:", "no tag or digest specified", "oras manifest delete [flags] <name>{:<tag>|@<digest>}", "You need to specify a reference").Exec()
ORAS("manifest", "delete", RegistryRef(ZOTHost, dstRepo, "")).ExpectFailure().MatchErrKeyWords("Error:", "no tag or digest specified", "oras manifest delete [flags] <name>{:<tag>|@<digest>}", "Please specify a reference").Exec()

})
})
Expand Down Expand Up @@ -289,7 +289,7 @@ var _ = Describe("1.1 registry users:", func() {
})

It("should fail if no manifest tag or digest is provided", func() {
ORAS("manifest", "fetch", RegistryRef(ZOTHost, ImageRepo, "")).ExpectFailure().MatchErrKeyWords("Error:", "no tag or digest specified", "oras manifest fetch [flags] <name>{:<tag>|@<digest>}", "You need to specify a reference").Exec()
ORAS("manifest", "fetch", RegistryRef(ZOTHost, ImageRepo, "")).ExpectFailure().MatchErrKeyWords("Error:", "no tag or digest specified", "oras manifest fetch [flags] <name>{:<tag>|@<digest>}", "Please specify a reference").Exec()
})
})

Expand Down Expand Up @@ -467,7 +467,7 @@ var _ = Describe("OCI image layout users:", func() {
It("should fail with suggestion if no tag or digest is provided", func() {
root := PrepareTempOCI(ImageRepo)
ORAS("manifest", "fetch", Flags.Layout, root).ExpectFailure().
MatchErrKeyWords("Error:", "no tag or digest specified", "oras manifest fetch [flags] <name>{:<tag>|@<digest>}", "You need to specify a reference").Exec()
MatchErrKeyWords("Error:", "no tag or digest specified", "oras manifest fetch [flags] <name>{:<tag>|@<digest>}", "Please specify a reference").Exec()
})
})

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/suite/command/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var _ = Describe("ORAS beginners:", func() {
ORAS("resolve", fmt.Sprintf("%s/%s", ZOTHost, InvalidRepo)).ExpectFailure().MatchErrKeyWords("Error:", fmt.Sprintf("invalid reference: invalid repository %q", InvalidRepo)).Exec()
})
It("should fail when no tag or digest provided", func() {
ORAS("resolve", RegistryRef(ZOTHost, ImageRepo, "")).ExpectFailure().MatchErrKeyWords("Error:", `no tag or digest specified`, "oras resolve [flags] <name>{:<tag>|@<digest>}", "You need to specify a reference").Exec()
ORAS("resolve", RegistryRef(ZOTHost, ImageRepo, "")).ExpectFailure().MatchErrKeyWords("Error:", `no tag or digest specified`, "oras resolve [flags] <name>{:<tag>|@<digest>}", "Please specify a reference").Exec()
})
It("should fail when provided manifest reference is not found", func() {
ORAS("resolve", RegistryRef(ZOTHost, ImageRepo, "i-dont-think-this-tag-exists")).ExpectFailure().MatchErrKeyWords("Error: failed to resolve digest:", "not found").Exec()
Expand Down

0 comments on commit 47606e3

Please sign in to comment.