You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by kv...@apache.org on 2020/12/14 02:49:11 UTC
[apisix-ingress-controller] branch master updated: ci: report go
unit-test coverage profile (#89)
This is an automated email from the ASF dual-hosted git repository.
kvn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git
The following commit(s) were added to refs/heads/master by this push:
new 7a4000b ci: report go unit-test coverage profile (#89)
7a4000b is described below
commit 7a4000b086db336d2fcc5dcd321301ce666c38fc
Author: Alex Zhang <zc...@gmail.com>
AuthorDate: Mon Dec 14 10:49:02 2020 +0800
ci: report go unit-test coverage profile (#89)
---
.github/workflows/unit-test-ci.yml | 8 ++++++--
.gitignore | 1 +
Makefile | 4 ++++
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/unit-test-ci.yml b/.github/workflows/unit-test-ci.yml
index 4da2ece..527ed96 100644
--- a/.github/workflows/unit-test-ci.yml
+++ b/.github/workflows/unit-test-ci.yml
@@ -4,7 +4,7 @@ on:
push:
branches:
- master
- - kv/ci
+ - ci/go-unit-test-coverage-report
pull_request:
branches:
- master
@@ -20,4 +20,8 @@ jobs:
- name: run unit test
working-directory: ./
run: |
- go test ./...
+ make unit-test
+ - name: upload coverage profile
+ working-directory: ./
+ run: |
+ bash <(curl -s https://codecov.io/bash)
diff --git a/.gitignore b/.gitignore
index ed1bb99..0fdeedf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,5 +13,6 @@
.idea
.DS_Store
+coverage.txt
apisix-ingress-controller
.actions/openwhisk-utilities
diff --git a/Makefile b/Makefile
index 76dd71b..8df39d0 100644
--- a/Makefile
+++ b/Makefile
@@ -40,6 +40,10 @@ build:
lint:
golangci-lint run
+### unit-test: Run unit test cases
+unit-test:
+ go test -cover -coverprofile=coverage.txt ./...
+
### license-check: Do Apache License Header check
license-check:
ifeq ("$(wildcard .actions/openwhisk-utilities/scancode/scanCode.py)", "")