ShiningRush commented on a change in pull request #1270: URL: https://github.com/apache/apisix-dashboard/pull/1270#discussion_r558288412
########## File path: .github/workflows/backend-test.yml ########## @@ -0,0 +1,122 @@ +name: Backend Unit Test + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + + backend-unit-test: + runs-on: ubuntu-latest + + services: + etcd: + image: bitnami/etcd:3.4.13 + ports: + - 2379:2379 + - 2380:2380 + env: + ALLOW_NONE_AUTHENTICATION: yes + + steps: + - uses: actions/checkout@v2 + + - name: get lua lib + run: | + wget https://github.com/api7/dag-to-lua/archive/v1.1.tar.gz + sudo mkdir -p ./api/dag-to-lua + tar -zxvf v1.1.tar.gz + sudo mv ./dag-to-lua-1.1/lib/* ./api/dag-to-lua/ + + - name: setup go + uses: actions/[email protected] + with: + go-version: '1.13' + + - name: run test + run: | + make api-test + + - name: output test coverage + working-directory: ./api + run: | + go tool cover -func=./coverage.txt + + - name: upload coverage file + uses: actions/upload-artifact@v1 + with: + name: coverage-file + path: ./api/coverage.txt + + + backend-e2e-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: setup go + uses: actions/[email protected] + with: + go-version: '1.13' + + - name: run docker compose + working-directory: ./api/test/docker + run: | + docker-compose up -d + sleep 5 + docker logs docker_managerapi_1 + + - name: run test + working-directory: ./api/test/e2e + run: go test -v + + - name: re-generate json schema + working-directory: ./api/ + run: | + curl 127.0.0.1:9090/v1/schema > ./conf/schema.json + + - name: stop docker compose + working-directory: ./api/test/docker + run: | + docker-compose down + sleep 10 + + - name: re-run docker compose + working-directory: ./api/test/docker + run: | + docker-compose up -d --build + sleep 5 + docker logs docker_managerapi_1 + + - name: run test for plugin skywalking + working-directory: ./api/test/e2e/skywalking + run: go test -v + + - name: output test coverage + working-directory: ./api/test/testdata + run: | + go tool cover -func=./integrationcover.out + + - name: download coverage file + uses: actions/download-artifact@v2 + with: + name: coverage-file + + - name: merge coverage file + run: | + git clone https://github.com/wadey/gocovmerge.git + cd gocovmerge + go build . + cd ../ + ./gocovmerge/gocovmerge ./api/test/testdata/integrationcover.out coverage.txt > ./api/coverage.txt Review comment: Is it possible to show e2e and unit test coverage in different graph?It is helpful to know the real e2e coverage. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
