This is an automated email from the ASF dual-hosted git repository. hoshea pushed a commit to branch fix/import-images in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git
commit db2a3e1133c702fafecba6b234002f04046ebf9d Author: fgksgf <[email protected]> AuthorDate: Tue Jan 27 11:27:46 2026 +0800 test: add E2E test case for KinD import-images functionality Verify that the import-images feature works correctly after upgrading kind dependency to v0.27.0. - Add test/e2e/kind/ with KinD cluster config, test pod, and expected result - Add e2e-test-kind target in Makefile for local testing - Update CI workflow to run KinD E2E test - Update test/e2e/README.md with new directory structure --- .github/workflows/e2e-test.yaml | 9 +++++++++ Makefile | 7 +++++++ test/e2e/README.md | 12 +++++++++--- test/e2e/kind/deployment.yaml | 25 +++++++++++++++++++++++++ test/e2e/kind/e2e.yaml | 39 +++++++++++++++++++++++++++++++++++++++ test/e2e/kind/expected.yaml | 16 ++++++++++++++++ test/e2e/kind/kind-cluster.yaml | 19 +++++++++++++++++++ 7 files changed, 124 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 352f384..4241ef2 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -59,3 +59,12 @@ jobs: uses: apache/skywalking-infra-e2e@main with: e2e-file: ./test/e2e/e2e.yaml + + - name: Install KinD + run: | + curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.27.0/kind-linux-amd64 + chmod +x ./kind + sudo mv ./kind /usr/local/bin/kind + + - name: Run KinD E2E Test + run: make e2e-test-kind diff --git a/Makefile b/Makefile index 42b3cbe..5512de9 100644 --- a/Makefile +++ b/Makefile @@ -111,3 +111,10 @@ uninstall: $(GOOS) e2e-test: $(GOOS) - make build - ./bin/$(GOOS)/$(PROJECT) run -c ./test/e2e/e2e.yaml + +.PHONY: e2e-test-kind +# Run E2E test with KinD to verify import-images functionality +e2e-test-kind: + $(MAKE) $(GOOS) + docker pull busybox:latest + ./bin/$(GOOS)/$(PROJECT) run -c ./test/e2e/kind/e2e.yaml diff --git a/test/e2e/README.md b/test/e2e/README.md index 35e339c..dc68911 100644 --- a/test/e2e/README.md +++ b/test/e2e/README.md @@ -9,7 +9,7 @@ You can perform testing locally. And when you submit a pull request (PR), GitHub |- concurrency |- fail-fast (concurrency & fail-fast mode) |- internal - |- expected.yaml + |- expected.yaml |- verify.yaml (configuration file) |- expected.yaml |- non-fail-fast (concurrency & non-fail-fast mode) @@ -17,7 +17,7 @@ You can perform testing locally. And when you submit a pull request (PR), GitHub |- expected.yaml |- verify.yaml (configuration file) |- expected.yaml - |- non-concurrency + |- non-concurrency |- fail-fast (non-concurrency & fail-fast mode) |- internal |- expected.yaml @@ -28,6 +28,11 @@ You can perform testing locally. And when you submit a pull request (PR), GitHub |- expected.yaml |- verify.yaml (configuration file) |- expected.yaml + |- kind (KinD import-images test) + |- kind-cluster.yaml (KinD cluster configuration) + |- e2e.yaml (E2E test configuration with import-images) + |- deployment.yaml (test Pod definition) + |- expected.yaml (expected result) |- docker-compose.yaml (run a httpbin container, which can return YAML data) |- e2e.yaml (configuration file for the outer infra E2E) @@ -143,7 +148,8 @@ skippedCount: 0 add the name of the cases to 'passed','failed' or 'skipped'. And add the number of cases on 'passedCount','failedCount' and 'skippedCount'. ## Tips -- You can use `make e2e-test` to run the test locally +- You can use `make e2e-test` to run the docker-compose test locally +- You can use `make e2e-test-kind` to run the KinD import-images test locally - You may need to split your PR to pass e2e tests in CI ``` # /internal/expected.yaml diff --git a/test/e2e/kind/deployment.yaml b/test/e2e/kind/deployment.yaml new file mode 100644 index 0000000..ed727a6 --- /dev/null +++ b/test/e2e/kind/deployment.yaml @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: Pod +metadata: + name: import-test +spec: + containers: + - name: test + image: busybox:latest + imagePullPolicy: Never # Force using locally imported image + command: ["sleep", "3600"] diff --git a/test/e2e/kind/e2e.yaml b/test/e2e/kind/e2e.yaml new file mode 100644 index 0000000..20dc72e --- /dev/null +++ b/test/e2e/kind/e2e.yaml @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file tests the import-images functionality with KinD. + +setup: + env: kind + file: kind-cluster.yaml + timeout: 10m + kind: + import-images: + - busybox:latest + steps: + - name: deploy test pod + command: kubectl apply -f test/e2e/kind/deployment.yaml + +cleanup: + on: always + +verify: + retry: + count: 10 + interval: 5s + cases: + - name: verify pod running with imported image + query: kubectl get pod import-test -o jsonpath='{.status.phase}' + expected: expected.yaml diff --git a/test/e2e/kind/expected.yaml b/test/e2e/kind/expected.yaml new file mode 100644 index 0000000..90d6c77 --- /dev/null +++ b/test/e2e/kind/expected.yaml @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +Running diff --git a/test/e2e/kind/kind-cluster.yaml b/test/e2e/kind/kind-cluster.yaml new file mode 100644 index 0000000..1081c51 --- /dev/null +++ b/test/e2e/kind/kind-cluster.yaml @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: + - role: control-plane
