Repository navigation
test: add e2e framework and test runner - #67
kaffie-1517 wants to merge 28 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive E2E testing suite for Volcano-Global, including deployment automation, test execution scripts, and a multi-cluster testing framework. Feedback focuses on improving the robustness and portability of the environment by pinning tool versions and disabling CGO, while also suggesting the parameterization of hardcoded cluster names and dependency versions to enhance framework flexibility.
|
|
||
| # Install ginkgo | ||
| echo "Installing ginkgo..." | ||
| GO111MODULE=on go install github.com/onsi/ginkgo/v2/ginkgo@latest |
There was a problem hiding this comment.
Installing ginkgo with @latest can lead to non-deterministic test environments if a new version is released with breaking changes. It is better to pin the version to match the one defined in go.mod.
| GO111MODULE=on go install github.com/onsi/ginkgo/v2/ginkgo@latest | |
| GO111MODULE=on go install github.com/onsi/ginkgo/v2/ginkgo@v2.28.1 |
| kubectl --context karmada-apiserver get ns default >/dev/null | ||
|
|
||
| set +e | ||
| GOOS=$(go env GOHOSTOS) GOARCH=$(go env GOHOSTARCH) CGO_ENABLED=1 \ |
There was a problem hiding this comment.
Setting CGO_ENABLED=1 might cause build failures in environments without a C compiler (like some CI runners). Since E2E tests typically only perform API calls, CGO is likely unnecessary. Consider setting it to 0 for better portability.
| GOOS=$(go env GOHOSTOS) GOARCH=$(go env GOHOSTARCH) CGO_ENABLED=1 \ | |
| GOOS=$(go env GOHOSTOS) GOARCH=$(go env GOHOSTARCH) CGO_ENABLED=0 \ |
| IMAGE_PREFIX=${IMAGE_PREFIX:-"volcanosh"} | ||
| KARMADA_KUBECONFIG=${KARMADA_KUBECONFIG:-"${HOME}/.kube/karmada.config"} | ||
| KARMADA_HOST_CLUSTER=${KARMADA_HOST_CLUSTER:-"karmada-host"} | ||
| VOLCANO_VERSION=${VOLCANO_VERSION:-"release-1.10"} |
There was a problem hiding this comment.
The default VOLCANO_VERSION is set to release-1.10, but the project appears to be using a much newer version (v1.14.0-alpha.0 according to go.mod). Using an outdated version for CRDs might lead to compatibility issues.
| VOLCANO_VERSION=${VOLCANO_VERSION:-"release-1.10"} | |
| VOLCANO_VERSION=${VOLCANO_VERSION:-"master"} |
|
Thanks @kaffie-1517, but I didn't see any github workflow has been added in this PR, did you miss it? With github workflow, we can know that whether a PR will have bugs or have influence before the merge, and it's better for me to judge your PR, no need to build the clusters from the scratch |
This PR merges the deliverables from PR3 and PR4 into a single cohesive PR (volcano-sh#67) per maintainer feedback. - Adds comprehensive E2E test cases for VCJob, Quota, DataDependency, and HyperJob - Adds GitHub Actions CI workflow to run tests automatically - Pins all actions to specific SHAs for security - Adds e2e test documentation - Refactors test suites to use shared configurable member clusters and helpers - Bumps ginkgo to v2.28.3 Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
d313e52 to
2d7dd11
Compare
| gomega.Expect(got.Spec.ReplicatedJobs).To(gomega.HaveLen(1)) | ||
|
|
||
| // If the HyperJob controller is active, child VCJobs should appear. | ||
| failures := gomega.InterceptGomegaFailures(func() { |
There was a problem hiding this comment.
The HyperJob controller does not seem to be enabled in the e2e setup. The controller-manager manifest still only runs --controllers=dispatcher, so this test can pass without actually covering HyperJob reconciliation.
Can we enable the HyperJob controller before running this e2e test, or enable it during the e2e installation?
| gomega.Expect(got.Spec.DataSourceName).To(gomega.Equal("db.table")) | ||
|
|
||
| // If the DataDependency controller is active, it should update claim status. | ||
| failures := gomega.InterceptGomegaFailures(func() { |
There was a problem hiding this comment.
The DataDependency controller and DataDependencyAwareness feature gate do not seem to be enabled in the e2e setup. This means the test mainly covers DataSource/DataSourceClaim CRUD, but not the actual DataDependency behavior.
Can we enable the controller and feature gate before running this e2e test, or enable them during the e2e installation?
2d7dd11 to
545638d
Compare
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
…l deployment Made-with: Cursor Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
…ry loop with kubectl wait Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
When setup-karmada.sh downloads Karmada as a tarball, the extracted directory has no .git folder. Go 1.18+ attempts to stamp the binary with VCS info and fails with 'error obtaining VCS status: exit status 128' on Linux/CI environments where Git's dubious-ownership check is also triggered. Setting GOFLAGS=-buildvcs=false before calling local-up-karmada.sh disables VCS stamping, which is the fix recommended by the Go toolchain error message itself. Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
The Dockerfiles in installer/dockerfile/ hardcode golang:1.24 but the effective minimum Go version required by the full module graph (via k8s.io v0.34.1 transitive deps) is >= 1.25. Rather than modifying the main-codebase Dockerfiles, stream a sed-patched version to docker build via stdin and run deploy-volcano-global.sh with SKIP_BUILD=true. Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
071e915 to
a20d084
Compare
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
4b9742a to
035620a
Compare
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
…rtions Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Signed-off-by: kaffie-1517 <jasmeetsingh171002@gmail.com>
Summary
This PR adds the Ginkgo e2e test framework, runner scripts, and Go module dependencies needed to write and execute end-to-end tests for volcano-global. It provides shared multi-cluster clients, CRUD + wait helpers for every volcano-global resource type, and a
make e2e-testentrypoint.Changes in this PR
test/e2e/framework/clients.go: sharedClientsstruct holding Karmada, host, member Kube + Volcano clientsetstest/e2e/framework/framework.go:BeforeSuiteinit, namespace helpers, polling constants, CLI flags for kubeconfig pathstest/e2e/framework/vcjob.go: Create / Delete / Get / WaitForStatus helpers for VCJobtest/e2e/framework/queue.go: Create / Delete / Get / WaitForOpen helpers for Queuetest/e2e/framework/propagationpolicy.go: Create / Delete helpers for PropagationPolicytest/e2e/framework/resourcebinding.go: WaitForSuspended / WaitForUnsuspended / WaitForExists helpers for ResourceBindingtest/e2e/framework/hyperjob.go: Create / Delete / Get / WaitForChildJobs helpers for HyperJobtest/e2e/e2e_suite_test.go: Ginkgo bootstrap that registers the framework and runs all suiteshack/e2e.sh: top-level entrypoint withSKIP_SETUPsupport (callssetup-e2e-env.shthenrun-e2e.sh)hack/run-e2e.sh: installs ginkgo, ensures PATH, overridesGOOS/CGO_ENABLEDfor local runs, runs tests with--race --fail-fast -p, collects Kind + pod logsgo.mod/go.sum: addginkgo/v2,gomega, and transitive depsMakefile: adde2e-testtargetFollow-up changes
Test plan
Run the e2e tests locally against an existing Karmada + Volcano environment:
Verify Ginkgo discovers and executes suites:
Confirm all framework helpers compile:
Liked issue: