[pull] master from chaos-mesh:master #1274
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration Test | |
on: | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- .gitignore | |
- "**.md" | |
- .github/ISSUE_TEMPLATE/* | |
- .github/pull_request_template.md | |
# Not available for frontend code for now. | |
- "ui/**" | |
- .github/workflows/checklink.yaml | |
- .github/checklink_config.json | |
- .github/workflows/ci.yml | |
- .github/workflows/ci_skip.yml | |
- .github/workflows/codecov_unittest.yaml | |
- .github/workflows/e2e_test.yml | |
- .github/workflows/e2e_test_upload_cache.yml | |
- .github/workflows/license_checker.yml | |
- .github/workflows/must_update_changelog.yml | |
- .github/workflows/release_helm_chart.yml | |
- .github/workflows/upload_env_image.yml | |
- .github/workflows/upload_image.yml | |
- .github/workflows/upload_image_pr.yml | |
- .github/workflows/upload_latest_files.yml | |
- .github/workflows/upload_release_files.yml | |
permissions: read-all | |
jobs: | |
run: | |
name: Integration Test | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [amd64, arm64] | |
runs-on: ${{ fromJson('{"amd64":"ubuntu-20.04", "arm64":["self-hosted", "Linux", "ARM64"]}')[matrix.arch] }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Must use at least depth 2! | |
fetch-depth: 2 | |
- name: Create kind cluster | |
# released version of kind-action doesn't support arm64 | |
uses: helm/kind-action@4c7909140acfc81a05fc96fed8fea6673ba8ce80 | |
with: | |
kubectl_version: v1.23.1 | |
- name: Restrict access to kubeconfig # https://github.com/helm/helm/issues/9115 | |
run: chmod 600 ~/.kube/config | |
- name: Setup Helm | |
uses: azure/setup-helm@v3 | |
- name: Magic Kind DNS Fix | |
if: ${{ matrix.arch == 'arm64' }} | |
run: | | |
docker exec chart-testing-control-plane /bin/bash -c "sed -e 's/nameserver \(.*\)/nameserver 8.8.8.8/g' /etc/resolv.conf > /etc/resolv.conf.sed" | |
docker exec chart-testing-control-plane /bin/bash -c "cp /etc/resolv.conf.sed /etc/resolv.conf" | |
kubectl rollout restart deployment -n kube-system coredns | |
- uses: actions/setup-python@v2 | |
if: ${{ matrix.arch != 'arm64' }} # We can assume the self-hosted arm64 has a functional python | |
- uses: actions/setup-go@v4 | |
with: | |
check-latest: true | |
go-version-file: "go.mod" | |
- name: Build Chaos Mesh Build Env | |
if: ${{ github.event.pull_request }} | |
env: | |
IMAGE_BUILD_ENV_BUILD: ${{ contains(github.event.pull_request.labels.*.name, 'rebuild-build-env-image') }} | |
run: | | |
if [ "${IMAGE_BUILD_ENV_BUILD}" = "true" ] ; then | |
export IMAGE_BUILD_ENV_BUILD=1; | |
else | |
export IMAGE_BUILD_ENV_BUILD=0; | |
fi | |
make image-build-env | |
- name: Build Chaos Mesh Dev Env | |
if: ${{ github.event.pull_request }} | |
env: | |
IMAGE_DEV_ENV_BUILD: ${{ contains(github.event.pull_request.labels.*.name, 'rebuild-dev-env-image') }} | |
run: | | |
if [ "${IMAGE_DEV_ENV_BUILD}" = "true" ] ; then | |
export IMAGE_DEV_ENV_BUILD=1; | |
else | |
export IMAGE_DEV_ENV_BUILD=0; | |
fi | |
make image-dev-env | |
- name: Install Chaos Mesh | |
run: | | |
export CLUSTER="chart-testing" | |
hack/local-up-chaos-mesh.sh | |
kubectl set env deployment/chaos-dashboard SECURITY_MODE=true -n chaos-mesh | |
kubectl set env deployment/chaos-controller-manager SECURITY_MODE=true -n chaos-mesh | |
sleep 5 | |
kubectl port-forward -n chaos-mesh svc/chaos-dashboard 2333:2333 & | |
- name: Build chaosctl | |
run: | | |
make chaosctl | |
- name: Install localstack && aws client | |
run: | | |
helm repo add localstack-repo http://helm.localstack.cloud | |
helm upgrade --install localstack localstack-repo/localstack --version 0.6.14 | |
pip install awscli | |
kubectl wait --timeout=60s --for=condition=ready --all pod | |
- name: Run integration test | |
run: | | |
bash test/integration_test/run.sh | |
- name: post run - dump kubernetes cluster info | |
if: always() | |
run: | | |
kubectl cluster-info dump --all-namespaces --output-directory cluster-info-dump | |
- name: post run - upload kubernetes cluster info dump | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: integration-test-kubernetes-cluster-info-dump-${{ matrix.arch }} | |
path: cluster-info-dump | |
retention-days: 7 |