forked from apache/apisix
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (74 loc) · 2.92 KB
/
chaos.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
name: Chaos Test
on:
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true
jobs:
chaos-test:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
submodules: recursive
- name: Setup go
uses: actions/[email protected]
with:
go-version: "1.16"
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Creating minikube cluster
run: |
bash ./t/chaos/utils/setup_chaos_utils.sh start_minikube
wget https://raw.githubusercontent.com/apache/apisix-docker/master/alpine-local/Dockerfile
mkdir logs
docker build -t apache/apisix:alpine-local --build-arg APISIX_PATH=. -f Dockerfile .
minikube cache add apache/apisix:alpine-local -v 7 --alsologtostderr
- name: Print cluster information
run: |
kubectl config view
kubectl cluster-info
kubectl get nodes
kubectl get pods -n kube-system
kubectl version
- name: Deploy etcd with Helm
run: |
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install etcd bitnami/etcd --set replicaCount=3 --set auth.rbac.enabled=false
kubectl wait pods -l app.kubernetes.io/instance=etcd --for=condition=Ready --timeout=300s --all
- name: Deploy APISIX
run: |
bash ./t/chaos/utils/setup_chaos_utils.sh modify_config
kubectl create configmap apisix-gw-config.yaml --from-file=./conf/config.yaml
kubectl apply -f ./kubernetes/deployment.yaml
kubectl apply -f ./kubernetes/service.yaml
kubectl wait pods -l app=apisix-gw --for=condition=Ready --timeout=300s
kubectl apply -f https://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml
kubectl wait pods -l app=httpbin --for=condition=Ready --timeout=300s
bash ./t/chaos/utils/setup_chaos_utils.sh port_forward
- name: Deploy Chaos Mesh
run: |
curl -sSL https://mirrors.chaos-mesh.org/latest/install.sh | bash
- name: Install Ginkgo
run: |
go get -u github.com/onsi/ginkgo/ginkgo
sudo cp ~/go/bin/ginkgo /usr/local/bin
- name: Run test
working-directory: ./t/chaos
run: ginkgo -r --v --progress --trace
# Debug via SSH if previous steps failed
- name: Set up tmate session
if: ${{ failure() }}
uses: ./.github/actions/action-tmate
timeout-minutes: 15