Skip to content

Commit

Permalink
feat: use kubernetes-sigs/e2e-framework for e2e testing
Browse files Browse the repository at this point in the history
  • Loading branch information
veezhang committed Sep 28, 2023
1 parent 37218c3 commit 704f594
Show file tree
Hide file tree
Showing 33 changed files with 13,394 additions and 13,181 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ vendor
*.swp
*.swo
*~

coverage.txt
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ test: manifests generate check ## Run unit-tests.
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./pkg/... -coverprofile cover.out

##@ e2e
e2e: ginkgo kind ## Run e2e test.
PATH="${GOBIN}:${PATH}" ./hack/e2e.sh
e2e: kind ## Run e2e test.
PATH="${GOBIN}:${PATH}" ./hack/e2e.sh $(E2EARGS)

##@ Build
build: ## Build binary.
Expand Down Expand Up @@ -154,7 +154,7 @@ ginkgo:
$(call go-get-tool,$(GOBIN)/ginkgo,github.com/onsi/ginkgo/[email protected])

kind:
$(call go-get-tool,$(GOBIN)/kind,sigs.k8s.io/kind@v0.19.0)
$(call go-get-tool,$(GOBIN)/kind,sigs.k8s.io/kind@v0.20.0)

# go-get-tool will 'go get' any package $2 and install it to $1.
define go-get-tool
Expand Down
14 changes: 14 additions & 0 deletions apis/apps/v1alpha1/nebulacluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package v1alpha1
import (
"fmt"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
)
Expand Down Expand Up @@ -150,3 +151,16 @@ func (nc *NebulaCluster) IsStoragedSSLEnabled() bool {
func (nc *NebulaCluster) IsZoneEnabled() bool {
return nc.Spec.Metad.Config["zone_list"] != ""
}

func (nc *NebulaCluster) IsReady() bool {
return nc.Status.ObservedGeneration == nc.Generation && nc.IsConditionReady()
}

func (nc *NebulaCluster) IsConditionReady() bool {
for _, condition := range nc.Status.Conditions {
if condition.Type == NebulaClusterReady {
return condition.Status == corev1.ConditionTrue
}
}
return false
}
4 changes: 2 additions & 2 deletions apis/apps/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/autoscaling/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 704f594

Please sign in to comment.