| name: Chaos Test |
| |
| on: |
| pull_request: |
| branches: |
| - master |
| paths-ignore: |
| - 'docs/**' |
| |
| concurrency: |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| cancel-in-progress: true |
| |
| jobs: |
| chaos-test: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v2.3.4 |
| with: |
| submodules: recursive |
| |
| - name: Setup go |
| uses: actions/setup-go@v2.1.3 |
| with: |
| go-version: "1.14" |
| |
| - 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 |