You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2026/05/05 03:35:25 UTC
(superset-kubernetes-operator) branch main updated: ci: re-enable e2e tests and fix test-infrastructure breakage (#22)
This is an automated email from the ASF dual-hosted git repository.
villebro pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/superset-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 5463309 ci: re-enable e2e tests and fix test-infrastructure breakage (#22)
5463309 is described below
commit 54633096c6f2ce7934698db46468ab0195023c18
Author: Ville Brofeldt <33...@users.noreply.github.com>
AuthorDate: Mon May 4 20:35:20 2026 -0700
ci: re-enable e2e tests and fix test-infrastructure breakage (#22)
---
.github/workflows/test.yaml | 22 +++++++++++++++++++---
Makefile | 6 +++---
config/manager/kustomization.yaml | 3 ---
docs/developer-guide.md | 25 ++++++++++++++++++++++---
test/e2e/e2e_test.go | 19 +++++++++++++------
5 files changed, 57 insertions(+), 18 deletions(-)
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 392fbf8..3ff1c05 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -50,6 +50,22 @@ jobs:
flags: integration
token: ${{ secrets.CODECOV_TOKEN }}
- # TODO: enable E2E tests once test infrastructure is ready
- # e2e:
- # ...
+ e2e:
+ name: E2E
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
+ with:
+ go-version-file: go.mod
+ - name: Install kind
+ run: |
+ KIND_VERSION="v0.31.0"
+ KIND_CHECKSUM="eb244cbafcc157dff60cf68693c14c9a75c4e6e6fedaf9cd71c58117cb93e3fa"
+ curl -fsSLo ./kind "https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-amd64"
+ echo "${KIND_CHECKSUM} ./kind" | sha256sum -c -
+ chmod +x ./kind
+ sudo mv ./kind /usr/local/bin/kind
+ kind version
+ - name: Run E2E tests
+ run: make test-e2e
diff --git a/Makefile b/Makefile
index 6792539..8081abe 100644
--- a/Makefile
+++ b/Makefile
@@ -253,7 +253,7 @@ docker-push: ## Push docker image with the manager.
.PHONY: build-installer
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
mkdir -p dist
- cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
+ cd config/manager && $(KUSTOMIZE) edit set image ghcr.io/apache/superset-kubernetes-operator=${IMG}
$(KUSTOMIZE) build config/default > dist/install.yaml
##@ Deployment
@@ -272,7 +272,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
- cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
+ cd config/manager && $(KUSTOMIZE) edit set image ghcr.io/apache/superset-kubernetes-operator=${IMG}
$(KUSTOMIZE) build config/default | $(KUBECTL) apply --server-side -f -
.PHONY: undeploy
@@ -374,7 +374,7 @@ endif
.PHONY: bundle
bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
$(OPERATOR_SDK) generate kustomize manifests -q
- cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
+ cd config/manager && $(KUSTOMIZE) edit set image ghcr.io/apache/superset-kubernetes-operator=$(IMG)
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
$(OPERATOR_SDK) bundle validate ./bundle
diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml
index 3e8f0be..be811b5 100644
--- a/config/manager/kustomization.yaml
+++ b/config/manager/kustomization.yaml
@@ -6,6 +6,3 @@ images:
- name: ghcr.io/apache/superset-kubernetes-operator
newName: ghcr.io/apache/superset-kubernetes-operator
newTag: latest
-- name: controller
- newName: localhost/superset-operator
- newTag: dev
diff --git a/docs/developer-guide.md b/docs/developer-guide.md
index 820676f..fcbc0af 100644
--- a/docs/developer-guide.md
+++ b/docs/developer-guide.md
@@ -31,10 +31,19 @@ instance running on your laptop.
| Tool | Version | Install |
|---|---|---|
-| Docker (or Podman) | 20+ | [docs.docker.com](https://docs.docker.com/get-docker/) |
+| Docker daemon | 20+ | [Docker Desktop](https://docs.docker.com/get-docker/), [Colima](https://github.com/abiosoft/colima) (`brew install colima`), or [Podman](https://podman.io) |
| kubectl | 1.27+ | [kubernetes.io](https://kubernetes.io/docs/tasks/tools/) |
-| Kind | 0.20+ | `go install sigs.k8s.io/kind@latest` or `brew install kind` |
-| Go | 1.26+ | [go.dev](https://go.dev/dl/) |
+| Kind | 0.30+ | `brew install kind` or `go install sigs.k8s.io/kind@latest` |
+| Go | 1.26+ | `brew install go` or [go.dev](https://go.dev/dl/) |
+
+#### macOS notes
+
+- **Colima** is a lightweight alternative to Docker Desktop. Start it with enough headroom for Kind plus a Superset deployment:
+ ```bash
+ colima start --cpu 4 --memory 8 --disk 50
+ ```
+ The Docker CLI auto-switches to the `colima` context.
+- If you previously ran Docker Desktop and have switched to Colima, the leftover `credsStore: desktop` in `~/.docker/config.json` will fail every `docker pull` with a keychain error in non-interactive shells. Remove the `credsStore` and `plugins`/`features.hooks` keys from that file (they only apply to Docker Desktop).
### 1. Create a Kind cluster
@@ -291,6 +300,16 @@ validation, CRD defaulting, multi-controller interaction).
- CR lifecycle: apply Superset CR → child CRs created → Deployments + ConfigMaps exist → status populated
- Multi-component: all component types reconciled with correct sub-resources
+### Running E2E tests locally
+
+`make test-e2e` creates a throwaway Kind cluster (`superset-kubernetes-operator-test-e2e`), builds the operator image, loads it into the cluster, runs the Ginkgo specs, and tears the cluster down.
+
+```bash
+make test-e2e
+```
+
+The Kind node image is pinned in the Makefile (`KIND_NODE_IMAGE`) and matches the Kind binary version used in CI. Override `E2E_PROJECT_IMAGE` or `E2E_CURL_IMAGE` if your environment requires a mirror registry, or set `E2E_SKIP_BUILD_LOAD=1` to reuse an image you've already loaded into Kind during iteration.
+
### Writing a new unit test
Use the standard pattern from `reconcile_test.go`:
diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go
index 04665a3..42af060 100644
--- a/test/e2e/e2e_test.go
+++ b/test/e2e/e2e_test.go
@@ -37,13 +37,13 @@ import (
const namespace = "superset-operator-system"
// serviceAccountName created for the project
-const serviceAccountName = "superset-kubernetes-operator-controller-manager"
+const serviceAccountName = "superset-operator-controller-manager"
// metricsServiceName is the name of the metrics service of the project
-const metricsServiceName = "superset-kubernetes-operator-controller-manager-metrics-service"
+const metricsServiceName = "superset-operator-controller-manager-metrics-service"
// metricsRoleBindingName is the name of the RBAC that will be created to allow get the metrics data
-const metricsRoleBindingName = "superset-kubernetes-operator-metrics-binding"
+const metricsRoleBindingName = "superset-operator-metrics-binding"
var _ = Describe("Manager", Ordered, func() {
var controllerPodName string
@@ -81,6 +81,10 @@ var _ = Describe("Manager", Ordered, func() {
cmd := exec.Command("kubectl", "delete", "pod", "curl-metrics", "-n", namespace)
_, _ = utils.Run(cmd)
+ By("cleaning up the metrics ClusterRoleBinding")
+ cmd = exec.Command("kubectl", "delete", "clusterrolebinding", metricsRoleBindingName, "--ignore-not-found")
+ _, _ = utils.Run(cmd)
+
By("undeploying the controller-manager")
cmd = exec.Command("make", "undeploy")
_, _ = utils.Run(cmd)
@@ -175,8 +179,11 @@ var _ = Describe("Manager", Ordered, func() {
It("should ensure the metrics endpoint is serving metrics", func() {
By("creating a ClusterRoleBinding for the service account to allow access to metrics")
- cmd := exec.Command("kubectl", "create", "clusterrolebinding", metricsRoleBindingName,
- "--clusterrole=superset-kubernetes-operator-metrics-reader",
+ // Defensively delete any stale binding from a previous failed run before creating.
+ cmd := exec.Command("kubectl", "delete", "clusterrolebinding", metricsRoleBindingName, "--ignore-not-found")
+ _, _ = utils.Run(cmd)
+ cmd = exec.Command("kubectl", "create", "clusterrolebinding", metricsRoleBindingName,
+ "--clusterrole=superset-operator-metrics-reader",
fmt.Sprintf("--serviceaccount=%s:%s", namespace, serviceAccountName),
)
_, err := utils.Run(cmd)
@@ -206,7 +213,7 @@ var _ = Describe("Manager", Ordered, func() {
cmd := exec.Command("kubectl", "logs", controllerPodName, "-n", namespace)
output, err := utils.Run(cmd)
g.Expect(err).NotTo(HaveOccurred())
- g.Expect(output).To(ContainSubstring("controller-runtime.metrics\tServing metrics server"),
+ g.Expect(output).To(ContainSubstring(`"controller-runtime.metrics","msg":"Starting metrics server"`),
"Metrics server not yet started")
}
Eventually(verifyMetricsServerStarted).Should(Succeed())