forked from chaos-mesh/chaos-mesh
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (115 loc) · 4.5 KB
/
integration_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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