Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
p-se committed Dec 3, 2024
1 parent 4b70625 commit 7f239a6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions e2e/single-cluster/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"path"
"strings"

// "github.com/go-git/go-git/v5"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

Expand Down Expand Up @@ -125,7 +124,6 @@ var _ = FDescribe("Checks that template errors are shown in bundles and gitrepos
cloneDir string
k kubectl.Command
gh *githelper.Git
// clone *git.Repository
repoName string
inClusterRepoURL string
gitrepoName string
Expand Down Expand Up @@ -233,13 +231,13 @@ var _ = FDescribe("Checks that template errors are shown in bundles and gitrepos
g.Expect(found).To(BeTrue())
}

ensureClusterHasLabel := func() (string, error) {
ensureClusterHasLabelFoo := func() (string, error) {
return k.Namespace("fleet-local").
Patch("cluster", "local", "--type", "json", "--patch",
`[{"op": "add", "path": "/metadata/labels/foo", "value": "bar"}]`)
}

ensureClusterHasntLabel := func() (string, error) {
ensureClusterHasNoLabelFoo := func() (string, error) {
return k.Namespace("fleet-local").
Patch("cluster", "local", "--type", "json", "--patch",
`[{"op": "remove", "path": "/metadata/labels/foo"}]`)
Expand All @@ -251,15 +249,15 @@ var _ = FDescribe("Checks that template errors are shown in bundles and gitrepos
})

It("should have an error in the bundle", func() {
ensureClusterHasntLabel()
ensureClusterHasNoLabelFoo()

Check failure on line 252 in e2e/single-cluster/status_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Error return value is not checked (errcheck)
Eventually(func(g Gomega) {
status := getBundleStatus(g, k, gitrepoName+"-examples")
expectTargetingError(g, status.Conditions)
}).Should(Succeed())
})

It("should have an error in the gitrepo", func() {
ensureClusterHasntLabel()
ensureClusterHasNoLabelFoo()

Check failure on line 260 in e2e/single-cluster/status_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Error return value is not checked (errcheck)
Eventually(func(g Gomega) {
status := getGitRepoStatus(g, k, gitrepoName)
expectTargetingError(g, status.Conditions)
Expand All @@ -269,7 +267,7 @@ var _ = FDescribe("Checks that template errors are shown in bundles and gitrepos

When("a git repository is created that contains no template error", func() {
It("should have no error in the bundle", func() {
ensureClusterHasLabel()
ensureClusterHasLabelFoo()

Check failure on line 270 in e2e/single-cluster/status_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Error return value is not checked (errcheck)
Eventually(func(g Gomega) {
status := getBundleStatus(g, k, gitrepoName+"-examples")
expectNoError(g, status.Conditions)
Expand Down

0 comments on commit 7f239a6

Please sign in to comment.