Skip to content

Commit

Permalink
increase coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah committed Dec 13, 2024
1 parent d24fb9a commit 90c796c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/e2e/suite/command/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ var _ = Describe("ORAS beginners:", func() {
var _ = Describe("1.1 registry users:", func() {
When("running attach command", func() {
It("should attach a file to a subject and output status", func() {
testRepo := attachTestRepo("simple")
testRepo := attachTestRepo("attach-tag")
CopyZOTRepo(ImageRepo, testRepo)
subjectRef := RegistryRef(ZOTHost, testRepo, foobar.Tag)
ORAS("attach", "--artifact-type", "test/attach", subjectRef, fmt.Sprintf("%s:%s", foobar.AttachFileName, foobar.AttachFileMedia)).
Expand All @@ -147,6 +147,16 @@ var _ = Describe("1.1 registry users:", func() {
MatchStatus([]match.StateKey{foobar.AttachFileStateKey}, false, 1).Exec()
})

It("should attach a file to a subject and output status", func() {
testRepo := attachTestRepo("attach-digest")
CopyZOTRepo(ImageRepo, testRepo)
subjectRef := RegistryRef(ZOTHost, testRepo, foobar.Digest)
ORAS("attach", "--artifact-type", "test/attach", subjectRef, fmt.Sprintf("%s:%s", foobar.AttachFileName, foobar.AttachFileMedia)).
WithWorkDir(PrepareTempFiles()).
MatchKeyWords(fmt.Sprintf("Attached to [registry] %s", subjectRef)).
MatchStatus([]match.StateKey{foobar.AttachFileStateKey}, false, 1).Exec()
})

It("should attach a file to an arch-specific subject", func() {
// prepare
testRepo := attachTestRepo("arch-specific")
Expand Down

0 comments on commit 90c796c

Please sign in to comment.