Skip to content

Commit

Permalink
increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxiaoxuan273 committed Mar 25, 2024
1 parent 8b21e04 commit 4c4f143
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/e2e/suite/command/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var _ = Describe("ORAS beginners:", func() {

It("should fail if the provided reference is not valid", func() {
err := ORAS("push", "/oras").ExpectFailure().Exec().Err
gomega.Expect(err).Should(gbytes.Say(`Error: "/oras" is an invalid reference`))
gomega.Expect(err).Should(gbytes.Say(`Error: invalid reference: invalid registry "": "/oras" is an invalid reference`))
gomega.Expect(err).Should(gbytes.Say(regexp.QuoteMeta("Please make sure the provided reference is in the form of <registry>/<repo>[:tag|@digest]")))
})

Expand Down
4 changes: 4 additions & 0 deletions test/e2e/suite/command/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ var _ = Describe("ORAS beginners:", func() {
ORAS("tag", RegistryRef(ZOTHost, ImageRepo, InvalidTag), "tagged").ExpectFailure().MatchErrKeyWords(RegistryErrorPrefix).Exec()
})

It("should fail when the given reference is invalid", func() {
ORAS("tag", fmt.Sprintf("%s/%s:%s", ZOTHost, InvalidRepo, "test"), "latest").ExpectFailure().MatchErrKeyWords("Error:", "unable to add tag", "invalid reference").Exec()
})

It("should fail and show detailed error description if no argument provided", func() {
err := ORAS("tag").ExpectFailure().Exec().Err
gomega.Expect(err).Should(gbytes.Say("Error"))
Expand Down

0 comments on commit 4c4f143

Please sign in to comment.