Skip to content

test: add e2e framework and test runner - #67

Open
kaffie-1517 wants to merge 28 commits into
volcano-sh:mainfrom
kaffie-1517:e2e-ci-workflow
Open

kaffie-1517 wants to merge 28 commits into
volcano-sh:mainfrom
kaffie-1517:e2e-ci-workflow

Conversation

@kaffie-1517

Copy link
Copy Markdown

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-test entrypoint.

Changes in this PR

  • test/e2e/framework/clients.go : shared Clients struct holding Karmada, host, member Kube + Volcano clientsets
  • test/e2e/framework/framework.go : BeforeSuite init, namespace helpers, polling constants, CLI flags for kubeconfig paths
  • test/e2e/framework/vcjob.go : Create / Delete / Get / WaitForStatus helpers for VCJob
  • test/e2e/framework/queue.go : Create / Delete / Get / WaitForOpen helpers for Queue
  • test/e2e/framework/propagationpolicy.go : Create / Delete helpers for PropagationPolicy
  • test/e2e/framework/resourcebinding.go : WaitForSuspended / WaitForUnsuspended / WaitForExists helpers for ResourceBinding
  • test/e2e/framework/hyperjob.go : Create / Delete / Get / WaitForChildJobs helpers for HyperJob
  • test/e2e/e2e_suite_test.go : Ginkgo bootstrap that registers the framework and runs all suites
  • hack/e2e.sh : top-level entrypoint with SKIP_SETUP support (calls setup-e2e-env.sh then run-e2e.sh)
  • hack/run-e2e.sh : installs ginkgo, ensures PATH, overrides GOOS/CGO_ENABLED for local runs, runs tests with --race --fail-fast -p, collects Kind + pod logs
  • go.mod / go.sum : add ginkgo/v2, gomega, and transitive deps
  • Makefile : add e2e-test target

Follow-up changes

  • Test cases for all 4 scenarios
    • Add suites for: resource quota & priority, cross-cluster VCJob scheduling, data-dependency aware scheduling, and HyperJob scheduling
  • CI workflow and documentation
    • Add GitHub Actions workflow to run e2e in CI + docs for running/extending tests

Test plan

  • Run the e2e tests locally against an existing Karmada + Volcano environment:

    SKIP_SETUP=true make e2e-test
  • Verify Ginkgo discovers and executes suites:

    cd hack && ./run-e2e.sh
  • Confirm all framework helpers compile:

    go build ./test/e2e/...

Liked issue:

@volcano-sh-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jessestutler for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread hack/run-e2e.sh Outdated

# Install ginkgo
echo "Installing ginkgo..."
GO111MODULE=on go install github.com/onsi/ginkgo/v2/ginkgo@latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
GO111MODULE=on go install github.com/onsi/ginkgo/v2/ginkgo@latest
GO111MODULE=on go install github.com/onsi/ginkgo/v2/ginkgo@v2.28.1

Comment thread hack/run-e2e.sh
kubectl --context karmada-apiserver get ns default >/dev/null

set +e
GOOS=$(go env GOHOSTOS) GOARCH=$(go env GOHOSTARCH) CGO_ENABLED=1 \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
GOOS=$(go env GOHOSTOS) GOARCH=$(go env GOHOSTARCH) CGO_ENABLED=1 \
GOOS=$(go env GOHOSTOS) GOARCH=$(go env GOHOSTARCH) CGO_ENABLED=0 \

Comment thread hack/run-e2e.sh Outdated
Comment thread test/e2e/framework/clients.go Outdated
Comment thread hack/deploy-volcano-global.sh Outdated
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"}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
VOLCANO_VERSION=${VOLCANO_VERSION:-"release-1.10"}
VOLCANO_VERSION=${VOLCANO_VERSION:-"master"}

Comment thread hack/deploy-volcano-global.sh Outdated
@JesseStutler

Copy link
Copy Markdown
Member

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

kaffie-1517 added a commit to kaffie-1517/volcano-global that referenced this pull request May 14, 2026
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>
@kaffie-1517
kaffie-1517 force-pushed the e2e-ci-workflow branch 2 times, most recently from d313e52 to 2d7dd11 Compare May 14, 2026 10:53
Comment thread test/e2e/hyperjob/hyperjob_test.go Outdated
gomega.Expect(got.Spec.ReplicatedJobs).To(gomega.HaveLen(1))

// If the HyperJob controller is active, child VCJobs should appear.
failures := gomega.InterceptGomegaFailures(func() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

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>
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>
…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>
@kaffie-1517
kaffie-1517 requested a review from JesseStutler May 27, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants