From 2cfcc3ce014f347976b69d124ec5019315379d27 Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Mon, 5 Jan 2026 02:24:57 -0500 Subject: [PATCH 1/4] Fixup issues in E2E testing 1. Update the release process to include E2E testing of the new release. 2. Fix organization and other issues in the documentation of E2E testing. 3. Fix the indenting in test/e2e/setup-kubeflex.sh. 4. Make test/e2e/setup-kubeflex.sh follow the instructions of the release being tested. 5. Describe input to test/e2e/setup-kubeflex.sh in `on.workflow_call`. Signed-off-by: Mike Spreitzer --- .github/workflows/test-e2e.yaml | 6 +++ docs/contributors.md | 6 +++ test/e2e/README.md | 15 +++---- test/e2e/setup-kubeflex.sh | 80 ++++++++++++++++++--------------- 4 files changed, 60 insertions(+), 47 deletions(-) diff --git a/.github/workflows/test-e2e.yaml b/.github/workflows/test-e2e.yaml index b65fd6da..ffdd4731 100644 --- a/.github/workflows/test-e2e.yaml +++ b/.github/workflows/test-e2e.yaml @@ -2,11 +2,17 @@ name: E2E test on: workflow_call: + inputs: + release: + description: 'Kubeflex release to test (e.g. latest or v0.5.1)' + required: false + type: string workflow_dispatch: inputs: release: description: 'Kubeflex release to test (e.g. latest or v0.5.1)' required: false + type: string pull_request: branches: - main diff --git a/docs/contributors.md b/docs/contributors.md index 92cfbe0e..7b1037ba 100644 --- a/docs/contributors.md +++ b/docs/contributors.md @@ -87,6 +87,12 @@ LATEST_TAG= make ko-build-push-cmupdate ``` Wait until goreleaser completes the release process. +1. Invoke [the E2E test workflow](.github/workflows/test-e2e.yaml) on + the release just made (e.g, using [the GitHub web + UI](https://github.com/kubestellar/kubeflex/actions/workflows/test-e2e.yaml)). See + if it succeeds. If not then there is a problem that needs to be + remedied and a newer release made. + 1. The goreleaser workflow will also create a branch named `brew` with some changes (to the homebrew instsall script) that need to get merged into `main`. Make a PR to merge `brew` into `main`, and get it approved and merged. 1. To avoid leaving a time bomb, delete that `brew` branch after it was merged into `main` (the goreleaser will fail to create the new `brew` branch if one already exists). diff --git a/test/e2e/README.md b/test/e2e/README.md index 704bd868..c571a29b 100644 --- a/test/e2e/README.md +++ b/test/e2e/README.md @@ -1,23 +1,18 @@ KubeFlex provides an end-to-end (E2E) test suite that validates full system behavior in a Kubernetes environment. -End-to-end tests that can be used manually by a contributor or be triggered by CI. +The end-to-end test suite can be used manually by a contributor and also is used in CI. + +The end-to-end test suite can either test the local sources or a given release. ## Prerequisites `kind`,`jq` and `kubectl` are required to run the test. ## Run E2E tests manually - #### The E2E test suite can be run in the following modes: - - local source builds - - a released KubeFlex version, specified with the `--release` option - -When a release is specified, the tests install KubeFlex from a published Helm chart. -The special value `latest` installs the most recent released version, while a literal -version installs that specific release. -From the root directory of this git repository, you can run: +From the root directory of this git repository, you can run any of the following commands. ```shell test/e2e/run.sh # Run E2E tests against local source test/e2e/run.sh --release latest # Run E2E tests against the latest released version -test/e2e/run.sh --release v0.9.2 # Run E2E tests against a specific release +test/e2e/run.sh --release v0.9.1 # Run E2E tests against a specific release ``` diff --git a/test/e2e/setup-kubeflex.sh b/test/e2e/setup-kubeflex.sh index 27be51ef..dec63565 100755 --- a/test/e2e/setup-kubeflex.sh +++ b/test/e2e/setup-kubeflex.sh @@ -19,17 +19,17 @@ release="" while [[ $# -gt 0 ]]; do case "$1" in --release) - if [[ $# -lt 2 ]]; then - echo "Error: --release requires a value (e.g. v0.9.2 or latest)" - exit 1 - fi - release="$2" - shift 2 - ;; - *) - echo "Unknown argument: $1" - exit 1 - ;; + if [[ $# -lt 2 ]]; then + echo "Error: --release requires a value (e.g. v0.9.2 or latest)" + exit 1 + fi + release="$2" + shift 2 + ;; + *) + echo "Unknown argument: $1" + exit 1 + ;; esac done SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) @@ -46,30 +46,27 @@ kubectl -n ingress-nginx patch deployment/ingress-nginx-controller --patch-file= : : ------------------------------------------------------------------------- if [[ -z "${release}" ]]; then -echo "Installing kubeflex from local source" -: Compile binaries -: -make build + echo "Installing kubeflex from local source" + : Compile binaries + : + make build -: -: ------------------------------------------------------------------------- -: Build the OCI image for the kubeflex controller manager and load it in the local docker registry -: -: -make ko-local-build + : + : ------------------------------------------------------------------------- + : Build the OCI image for the kubeflex controller manager and load it in the local docker registry + : + : + make ko-local-build -: -: ------------------------------------------------------------------------- -: Load the local image in kind, re-generate manifests and helm chart, and install the helm chart: -: -: -make install-local-chart -: -: + : + : ------------------------------------------------------------------------- + : Load the local image in kind, re-generate manifests and helm chart, and install the helm chart: + : + : + make install-local-chart + : + : else - echo "Installing kubeflex release: ${release}" - kubectl create namespace kubeflex-system --dry-run=client -o yaml | kubectl apply -f - - if [[ "${release}" == "latest" ]]; then echo "Resolving latest kubeflex release from GitHub" release="$(curl -fsSL https://api.github.com/repos/kubestellar/kubeflex/releases/latest \ @@ -82,11 +79,20 @@ else echo "Resolved latest release to ${release}" fi - echo "Installing kubeflex release ${release}" - helm install kubeflex \ - oci://ghcr.io/kubestellar/kubeflex/chart/kubeflex-operator \ - --version "${release}" + + if [[ "${release}" < v0.9.2 ]]; then + kubectl create namespace kubeflex-system --dry-run=client -o yaml | kubectl apply -f - + helm install kubeflex \ + oci://ghcr.io/kubestellar/kubeflex/chart/kubeflex-operator \ + --namespace kubeflex-system \ + --version "${release}" + else + helm install kubeflex \ + oci://ghcr.io/kubestellar/kubeflex/chart/kubeflex-operator \ + --version "${release}" + fi + fi : : ------------------------------------------------------------------------- @@ -144,4 +150,4 @@ EOF : Wait for kubeflex-controller-manager ready : -kubectl wait --for=condition=available --timeout=300s -n kubeflex-system deployment/kubeflex-controller-manager \ No newline at end of file +kubectl wait --for=condition=available --timeout=300s -n kubeflex-system deployment/kubeflex-controller-manager From 10251b22d0af6c1430d507b1039e5b487aab2cf9 Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Mon, 5 Jan 2026 03:13:57 -0500 Subject: [PATCH 2/4] Install the kflex binary from the release too Signed-off-by: Mike Spreitzer --- test/e2e/setup-kubeflex.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/setup-kubeflex.sh b/test/e2e/setup-kubeflex.sh index dec63565..e9c75889 100755 --- a/test/e2e/setup-kubeflex.sh +++ b/test/e2e/setup-kubeflex.sh @@ -81,6 +81,8 @@ else fi echo "Installing kubeflex release ${release}" + bash <(curl -s https://raw.githubusercontent.com/kubestellar/kubeflex/refs/tags/${release}/scripts/install-kubeflex.sh) --version $release --ensure-folder bin --strip-bin -X + if [[ "${release}" < v0.9.2 ]]; then kubectl create namespace kubeflex-system --dry-run=client -o yaml | kubectl apply -f - helm install kubeflex \ From 071349ef839ea6d78a8b45d202efc1cde8531a6a Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Mon, 5 Jan 2026 03:48:39 -0500 Subject: [PATCH 3/4] Fix Helm release name used when installing a kf release Signed-off-by: Mike Spreitzer --- test/e2e/setup-kubeflex.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/setup-kubeflex.sh b/test/e2e/setup-kubeflex.sh index e9c75889..a3f0a1be 100755 --- a/test/e2e/setup-kubeflex.sh +++ b/test/e2e/setup-kubeflex.sh @@ -85,12 +85,12 @@ else if [[ "${release}" < v0.9.2 ]]; then kubectl create namespace kubeflex-system --dry-run=client -o yaml | kubectl apply -f - - helm install kubeflex \ + helm install kubeflex-operator \ oci://ghcr.io/kubestellar/kubeflex/chart/kubeflex-operator \ --namespace kubeflex-system \ --version "${release}" else - helm install kubeflex \ + helm install kubeflex-operator \ oci://ghcr.io/kubestellar/kubeflex/chart/kubeflex-operator \ --version "${release}" fi From ac3eb2e5ef4ff956942b58f42fb27ebe1cb98b99 Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Mon, 5 Jan 2026 13:20:25 -0500 Subject: [PATCH 4/4] Fix comparison, relative link Signed-off-by: Mike Spreitzer --- docs/contributors.md | 2 +- test/e2e/setup-kubeflex.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/contributors.md b/docs/contributors.md index 7b1037ba..c82c584d 100644 --- a/docs/contributors.md +++ b/docs/contributors.md @@ -87,7 +87,7 @@ LATEST_TAG= make ko-build-push-cmupdate ``` Wait until goreleaser completes the release process. -1. Invoke [the E2E test workflow](.github/workflows/test-e2e.yaml) on +1. Invoke [the E2E test workflow](../.github/workflows/test-e2e.yaml) on the release just made (e.g, using [the GitHub web UI](https://github.com/kubestellar/kubeflex/actions/workflows/test-e2e.yaml)). See if it succeeds. If not then there is a problem that needs to be diff --git a/test/e2e/setup-kubeflex.sh b/test/e2e/setup-kubeflex.sh index a3f0a1be..84ce6fbe 100755 --- a/test/e2e/setup-kubeflex.sh +++ b/test/e2e/setup-kubeflex.sh @@ -83,15 +83,15 @@ else bash <(curl -s https://raw.githubusercontent.com/kubestellar/kubeflex/refs/tags/${release}/scripts/install-kubeflex.sh) --version $release --ensure-folder bin --strip-bin -X - if [[ "${release}" < v0.9.2 ]]; then - kubectl create namespace kubeflex-system --dry-run=client -o yaml | kubectl apply -f - + if [ "$( { echo v0.9.2; echo "$release"; } | sort -V | head -1)" == v0.9.2 ]; then helm install kubeflex-operator \ oci://ghcr.io/kubestellar/kubeflex/chart/kubeflex-operator \ - --namespace kubeflex-system \ --version "${release}" else + kubectl create namespace kubeflex-system --dry-run=client -o yaml | kubectl apply -f - helm install kubeflex-operator \ oci://ghcr.io/kubestellar/kubeflex/chart/kubeflex-operator \ + --namespace kubeflex-system \ --version "${release}" fi