workflows: include splunk_logger sub module in tests

This commit is contained in:
Florian Schüller 2024-08-14 16:50:39 +02:00 committed by Florian Schüller
parent a4068b328d
commit 11f707d277
3 changed files with 10 additions and 2 deletions

View file

@ -33,7 +33,7 @@ jobs:
run: git config --global --add safe.directory "$(pwd)"
- name: Run unit tests
run: go test -race -covermode=atomic -coverprofile=coverage.txt -coverpkg=$(go list ./... | grep -v rpmmd/test$ | tr "\n" ",") ./...
run: make unit-tests
- uses: codecov/codecov-action@v4
if: env.CODECOV_TOKEN

3
.gitignore vendored
View file

@ -17,3 +17,6 @@ __pycache__
container_composer_golangci_built.info
processed-templates
coverage.txt
coverage_splunk_logger.txt

View file

@ -234,8 +234,13 @@ worker-key-pair: ca
rm /etc/osbuild-composer/worker-csr.pem
.PHONY: unit-tests
.ONESHELL:
unit-tests:
go test -race ./...
go test -race -covermode=atomic -coverprofile=coverage.txt -coverpkg=$$(go list ./... | grep -v rpmmd/test$ | tr "\n" ",") ./...
# go modules with go.mod in subdirs are not tested automatically
cd pkg/splunk_logger
go test -race -covermode=atomic -coverprofile=../../coverage_splunk_logger.txt -coverpkg=$$(go list ./... | grep -v rpmmd/test$ | tr "\n" ",") ./...
#
# Building packages