Add local e2e test script
What would you like to be added: Two optional methods:
- Add a section in Makefile like this:
.PHONY: test-integration
test-integration: ...
- Add a new script named
local-e2e.sh, likerun-e2e.sh.
Why is this needed:
- Now we only have
run-e2e.shscript for github ci, but it will be convenient to have a e2e test script for local environment. - Also, we can reduce the pressure on github ci, because we don't need to commit everytime to trigger e2e test, if we can run test in local environment.
- Now after running the
run-e2e.shscript, it will generate some logs, and triggerpre-run-e2e.sh&post-run-e2e.shto create & delete extra components, which is not necessary for local environment(because it's designed for github ci environment). So we need another script for local e2e test.
@zhzhuang-zju
Now we only have run-e2e.sh script for github ci, but it will be convenient to have a e2e test script for local environment.
@B1F030 Can you remind me what difficulties you encountered using run-e2e.sh locally?
@B1F030 Can you remind me what difficulties you encountered using run-e2e.sh locally?
Updated.
Hi @B1F030, we actually has the ability to run e2e locally
First, you should install latest ginkgo:
$ go install github.com/onsi/ginkgo/v2/ginkgo
$ ginkgo version
Ginkgo Version 2.17.1
Then, change file directory to you local karmada repo
- If you want to run individual test case, you can do like this:
$ export KUBECONFIG=~/.kube/karmada.config
$ ginkgo -v --race --trace --fail-fast -p --focus="replicas divided and weighted testing when rescheduling" ./test/e2e/ -- --karmada-context=karmada-apiserver
the value of params --focus should be the text of ginkgo.Describe or ginkgo.Context or ginkgo.It, then it will run the individual e2e case below corresponding part.
- If you want to run all the test case, you can do like this:
$ export KUBECONFIG=~/.kube/karmada.config
$ hack/run-e2e.sh
Image: "docker.io/karmada/karmada-interpreter-webhook-example:latest" with ID "sha256:dc369188d4e3deeef02fc9f323e3992463856ade94dab4da07d04e4dc2b1c08e" not yet present on node "karmada-host-control-plane", loading...
Warning: resource configmaps/kube-proxy is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically.
configmap/kube-proxy configured
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 64992 100 64992 0 0 99k 0 --:--:-- --:--:-- --:--:-- 99k
namespace/metallb-system created
customresourcedefinition.apiextensions.k8s.io/addresspools.metallb.io created
customresourcedefinition.apiextensions.k8s.io/bfdprofiles.metallb.io created
customresourcedefinition.apiextensions.k8s.io/bgpadvertisements.metallb.io created
customresourcedefinition.apiextensions.k8s.io/bgppeers.metallb.io created
customresourcedefinition.apiextensions.k8s.io/communities.metallb.io created
......
Running Suite: E2E Suite - /root/home/gopath/src/github.com/chaosi-zju/karmada/test/e2e
=======================================================================================
Random Seed: 1718075379 - will randomize all specs
Will run 189 of 189 specs
Running in parallel across 4 processes
------------------------------
......
At last, it is more friendly to use first method for it can save more time.
Hi @B1F030, we actually has the ability to run e2e locally
Thanks! Really appreciate it.
/kind support /remove-kind feature /close
feel free to reopen if still have some problem.
@liangyuanpeng: The label(s) kind/support cannot be applied, because the repository doesn't have them.
In response to this:
/kind support /remove-kind feature /close
feel free to reopen if still have some problem.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
@liangyuanpeng: Closing this issue.
In response to this:
/kind support /remove-kind feature /close
feel free to reopen if still have some problem.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
/kind question