Skip to content

Commit

Permalink
add ephemeraljob e2e test in k8s1.23 (#945)
Browse files Browse the repository at this point in the history
Signed-off-by: JunjunLi <junjunli666@gmail.com>

upgrade golint v3
  • Loading branch information
hellolijj authored Apr 12, 2022
1 parent 92e437b commit 5b52b6e
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: |
make generate
- name: Lint golang code
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_VERSION }}
args: --verbose
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/e2e-1.23.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,63 @@ jobs:
fi
exit $retVal
ephemeraljob:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Kind Cluster
uses: helm/kind-action@v1.2.0
with:
node_image: ${{ env.KIND_IMAGE }}
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
config: ./test/kind-conf.yaml
- name: Build image
run: |
export IMAGE="openkruise/kruise-manager:e2e-${GITHUB_RUN_ID}"
docker build --pull --no-cache . -t $IMAGE
kind load docker-image --name=${KIND_CLUSTER_NAME} $IMAGE || { echo >&2 "kind not installed or error loading image: $IMAGE"; exit 1; }
- name: Install Kruise
run: |
set -ex
kubectl cluster-info
IMG=openkruise/kruise-manager:e2e-${GITHUB_RUN_ID} ./scripts/deploy_kind.sh
NODES=$(kubectl get node | wc -l)
for ((i=1;i<10;i++));
do
set +e
PODS=$(kubectl get pod -n kruise-system | grep '1/1' | wc -l)
set -e
if [ "$PODS" -eq "$NODES" ]; then
break
fi
sleep 3
done
set +e
PODS=$(kubectl get pod -n kruise-system | grep '1/1' | wc -l)
kubectl get node -o yaml
kubectl get all -n kruise-system -o yaml
kubectl get pod -n kruise-system --no-headers | grep daemon | awk '{print $1}' | xargs kubectl logs -n kruise-system
kubectl get pod -n kruise-system --no-headers | grep daemon | awk '{print $1}' | xargs kubectl logs -n kruise-system --previous=true
set -e
if [ "$PODS" -eq "$NODES" ]; then
echo "Wait for kruise-manager and kruise-daemon ready successfully"
else
echo "Timeout to wait for kruise-manager and kruise-daemon ready"
exit 1
fi
- name: Run E2E Tests
run: |
export KUBECONFIG=/home/runner/.kube/config
make ginkgo
set +e
./bin/ginkgo -timeout 60m -v --focus='\[apps\] EphemeralJob' test/e2e
other:
runs-on: ubuntu-18.04
steps:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/apps/ephemeraljob.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ var _ = SIGDescribe("EphemeralJob", func() {
gomega.Eventually(func() int {
job, _ := tester.GetEphemeralJob(job1.Name)
return int(job.Status.Running)
}, 60*time.Second, 3*time.Second).Should(gomega.Equal(1))
}, 180*time.Second, 3*time.Second).Should(gomega.Equal(1))

gomega.Eventually(func() int {
targetPods, err := tester.GetPodsByEjob(job1.Name)
Expand Down

0 comments on commit 5b52b6e

Please sign in to comment.