mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 11:50:18 +00:00
ci: document TEST_COVERAGE and GO_COVER_DIR in buid.env
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
4fd973b924
commit
3cc791c7c4
@ -20,9 +20,7 @@ branches:
|
||||
env:
|
||||
global:
|
||||
- GO111MODULE=on
|
||||
- TEST_COVERAGE=stdout
|
||||
- GO_METALINTER_THREADS=1
|
||||
- GO_COVER_DIR=_output
|
||||
- KUBECONFIG=$HOME/.kube/config
|
||||
# set CEPH_CSI_RUN_ALL_TESTS to non-empty to run all tests
|
||||
- CEPH_CSI_RUN_ALL_TESTS=true
|
||||
@ -83,7 +81,7 @@ jobs:
|
||||
- make go-lint
|
||||
- make lint-extras
|
||||
- make gosec
|
||||
- make go-test
|
||||
- make go-test TEST_COVERAGE=stdout GO_COVER_DIR=_output/
|
||||
- make mod-check
|
||||
|
||||
- stage: build testing
|
||||
|
4
Makefile
4
Makefile
@ -74,8 +74,10 @@ all: cephcsi
|
||||
test: go-test static-check mod-check
|
||||
static-check: check-env go-lint lint-extras gosec
|
||||
|
||||
go-test: TEST_COVERAGE ?= $(shell . $(CURDIR)/build.env ; echo $${TEST_COVERAGE})
|
||||
go-test: GO_COVER_DIR ?= $(shell . $(CURDIR)/build.env ; echo $${GO_COVER_DIR})
|
||||
go-test: check-env
|
||||
./scripts/test-go.sh
|
||||
TEST_COVERAGE=$(TEST_COVERAGE) GO_COVER_DIR=$(GO_COVER_DIR) ./scripts/test-go.sh
|
||||
|
||||
mod-check: check-env
|
||||
@echo 'running: go mod verify'
|
||||
|
@ -20,6 +20,11 @@ GO111MODULE=on
|
||||
GOLANGCI_VERSION=v1.21.0
|
||||
GOSEC_VERSION=2.0.0
|
||||
|
||||
# "go test" configuration
|
||||
# set to stdout or html to enable coverage reporting, disabled by default
|
||||
#TEST_COVERAGE=html
|
||||
#GO_COVER_DIR=_output/
|
||||
|
||||
# helm chart generation, testing and publishing
|
||||
HELM_VERSION=v3.1.2
|
||||
|
||||
|
@ -30,7 +30,7 @@ for gopackage in ${GOPACKAGES}; do
|
||||
fi
|
||||
if [[ ${TEST_COVERAGE} = "html" && -f cover.out ]]; then
|
||||
mkdir -p coverage
|
||||
fn="coverage/${gopackage////-}.html"
|
||||
fn="${GO_COVER_DIR}/${gopackage////-}.html"
|
||||
echo " * generating coverage html: ${fn}"
|
||||
go tool cover -html=cover.out -o "${fn}"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user