Skip to content

Commit

Permalink
add e2e
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
  • Loading branch information
qweeah committed Mar 6, 2023
1 parent 4c02c2b commit fd5d206
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/e2e/suite/command/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ package command

import (
"fmt"
"regexp"

. "github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
"oras.land/oras/test/e2e/internal/testdata/multi_arch"
. "oras.land/oras/test/e2e/internal/utils"
)
Expand All @@ -38,7 +41,10 @@ var _ = Describe("ORAS beginners:", func() {

var _ = Describe("Common registry users:", func() {
var tagAndValidate = func(reg string, repo string, tagOrDigest string, digest string, tags ...string) {
ORAS(append([]string{"tag", Reference(reg, repo, tagOrDigest)}, tags...)...).MatchKeyWords(append(tags, fmt.Sprintf("Tagging [registry] %s", Reference(reg, repo, digest)))...).Exec()
out := ORAS(append([]string{"tag", Reference(reg, repo, tagOrDigest)}, tags...)...).MatchKeyWords(tags...).Exec().Out
hint := regexp.QuoteMeta(fmt.Sprintf("Tagging [registry] %s", Reference(reg, repo, digest)))
gomega.Expect(out).To(gbytes.Say(hint))
gomega.Expect(out).NotTo(gbytes.Say(hint)) // should only say hint once
ORAS("repo", "tags", Reference(reg, repo, "")).MatchKeyWords(tags...).Exec()
}
When("running `tag`", func() {
Expand Down

0 comments on commit fd5d206

Please sign in to comment.