Skip to content
Snippets Groups Projects
Verified Commit 5566a1e7 authored by Levente Polyak's avatar Levente Polyak :rocket:
Browse files

feat(ci): expose test report as GitLab junit artifact

parent a8959f61
No related branches found
No related tags found
No related merge requests found
......@@ -8,9 +8,12 @@ lint:
test:
script:
- pacman -Syu --needed --noconfirm podman make
- make test
- make test BATS_EXTRA_ARGS='--formatter junit'
tags:
- vm
artifacts:
reports:
junit: coverage/bats-report.xml
code-coverage:
script:
......
......@@ -3,14 +3,17 @@ NETWORK:=none
RUN_OPTIONS:=--rm --network=$(NETWORK) -v $(PWD):/dbscripts:ro --tmpfs=/tmp:exec -w /dbscripts/test
CASES ?= cases
JOBS ?= $(shell nproc)
BATS_ARGS ?= --jobs $(JOBS) --verbose-run
BATS_EXTRA_ARGS ?=
BATS_ARGS ?= --jobs $(JOBS) $(BATS_EXTRA_ARGS) --verbose-run
DOCKER ?= podman
test-image:
$(DOCKER) build --pull -t $(IMAGE) test
test: test-image
$(DOCKER) run $(RUN_OPTIONS) $(IMAGE) make CASES=$(CASES) BATS_ARGS="$(BATS_ARGS)" test
rm -rf coverage
mkdir -m 777 coverage
$(DOCKER) run $(RUN_OPTIONS) -v ${PWD}/coverage:/coverage -e COVERAGE_DIR=/coverage $(IMAGE) make CASES=$(CASES) BATS_ARGS="$(BATS_ARGS)" test
test-coverage: test-image
rm -rf ${PWD}/coverage
......
SHELL=/bin/bash -o pipefail
CASES ?= cases
JOBS ?= $(shell nproc)
BATS_ARGS ?= --jobs $(JOBS) --verbose-run
COVERAGE_DIR ?= .
test:
BUILDDIR=/build PATH=$(CURDIR)/../:$(CURDIR)/../cron-jobs/:$(PATH) bats $(BATS_ARGS) $(CASES)
BUILDDIR=/build PATH=$(CURDIR)/../:$(CURDIR)/../cron-jobs/:$(PATH) bats $(BATS_ARGS) $(CASES) | tee $(COVERAGE_DIR)/bats-report.xml
test-coverage:
BUILDDIR=/build PATH=$(CURDIR)/../:$(CURDIR)/../cron-jobs/:$(PATH) kcov \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment