mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2025-09-26 21:01:14 +08:00
test: move all ginkgo opts to Makefile
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
6
.github/workflows/build.yaml
vendored
6
.github/workflows/build.yaml
vendored
@@ -135,11 +135,11 @@ jobs:
|
||||
|
||||
- name: Run tests
|
||||
if: ${{ matrix.target_arch == matrix.host_arch && matrix.target_os == matrix.host_os }}
|
||||
run: make tests GINKGO_EXTRA_OPTS=--procs=2 GINKGO_PKG=./pkg/...
|
||||
run: make tests
|
||||
|
||||
- name: Run tests requiring root privileges
|
||||
- name: Run integration tests
|
||||
if: ${{ matrix.target_arch == matrix.host_arch && matrix.target_os == matrix.host_os && matrix.host_os == 'linux' }}
|
||||
run: sudo --preserve-env env "PATH=$PATH" make tests GINKGO_PKG=./test/...
|
||||
run: sudo --preserve-env env "PATH=$PATH" make tests-integration
|
||||
|
||||
- name: Upload logs an packet captures as artifacts
|
||||
if: ${{ always() && matrix.target_arch == matrix.host_arch && matrix.target_os == matrix.host_os && matrix.host_os == 'linux' }}
|
||||
|
18
Makefile
18
Makefile
@@ -14,19 +14,16 @@ ifeq ($(GOOS),linux)
|
||||
PKGS += ./test/...
|
||||
endif
|
||||
|
||||
GINKGO_PKG ?= ./...
|
||||
GINKGO_OPTS += --compilers=2 \
|
||||
GINKGO_OPTS = --compilers=2 \
|
||||
--keep-going \
|
||||
--timeout=15m \
|
||||
--trace \
|
||||
--cover \
|
||||
--coverpkg=./... \
|
||||
--coverprofile=coverprofile.out \
|
||||
--keep-separate-coverprofiles \
|
||||
--output-dir=./test/logs \
|
||||
--randomize-all \
|
||||
--randomize-suites \
|
||||
$(GINKGO_EXTRA_OPTS) $(GINKGO_PKG) -- $(GINKGO_TEST_OPTS)
|
||||
$(GINKGO_EXTRA_OPTS)
|
||||
|
||||
all: wice
|
||||
|
||||
@@ -35,12 +32,16 @@ wice:
|
||||
go build -o $@ -ldflags="$(LDFLAGS)" ./cmd/wice
|
||||
|
||||
tests:
|
||||
ginkgo run $(GINKGO_OPTS)
|
||||
ginkgo run $(GINKGO_OPTS) --procs=2 --coverprofile=coverprofile.out ./pkg/...
|
||||
|
||||
tests-integration:
|
||||
mkdir -p test/logs
|
||||
ginkgo run $(GINKGO_OPTS) --output-dir=./test/logs --coverprofile=coverprofile_integration.out ./test
|
||||
|
||||
coverprofile_merged.out: $(shell find . -name "*.out" -type f)
|
||||
gocov-merger -o $@ $^
|
||||
|
||||
lcov_merged.info: coverprofile_merged.out
|
||||
lcov.info: coverprofile_merged.out
|
||||
gcov2lcov > $@ < $^
|
||||
|
||||
coverage: lcov.info
|
||||
@@ -65,6 +66,7 @@ install-deps:
|
||||
go install github.com/jandelgado/gcov2lcov@latest
|
||||
|
||||
clean:
|
||||
rm -f *.out wice lcov.info
|
||||
find . -name "*.out" -exec rm {} \;
|
||||
rm -rf wice lcov.info test/logs/
|
||||
|
||||
.PHONY: all wice tests tests-watch coverage clean vet staticcheck install-deps
|
Reference in New Issue
Block a user