Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
feat: Enable tests & coverage reports [#27, #28]
Browse files Browse the repository at this point in the history
  • Loading branch information
B&R committed Nov 26, 2022
1 parent 871d00f commit 329d918
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
sonarCloudEnabled: true
dockerReleasingEnabled: true
publishingHelmChartEnabled: false
testReportEnabled: true
coverageReportEnabled: true

secrets:
SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ pkg
/*.tar.zst
/*.tar.gz
/*.tar.xz
/junit.xml
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ push-docker: ## Release docker
docker push ghcr.io/riotkit-org/br-backup-maker:${DOCKER_TAG}

ensure-mysql:
command -v mysql || sudo apt install mysql-client -y
coverage: test ensure-mysql
@command -v mysql || sudo apt install mysql-client -y
ensure-go-junit-report:
@command -v go-junit-report || (cd /tmp && go install github.com/jstemmer/go-junit-report/v2@latest)
coverage: test ensure-mysql ensure-go-junit-report
test: prepare_e2e_workspace
# see versions.mk
export TEST_BACKUP_REPOSITORY_VERSION=${TEST_BACKUP_REPOSITORY_VERSION}; \
export TEST_POSTGRES_VERSION=${TEST_POSTGRES_VERSION}; \
export TEST_MINIO_VERSION=${TEST_MINIO_VERSION}; \
export TEST_MARIADB_VERSION=${TEST_MARIADB_VERSION}; \
go test -v ./... -covermode=count -coverprofile=coverage.out
export PATH=$$PATH:~/go/bin:$$GOROOT/bin; go test -v ./... -covermode=count -coverprofile=coverage.out 2>&1 | go-junit-report -set-exit-code -out junit.xml -iocopy

prepare_e2e_workspace:
sudo rm -rf .build/filesystem-config
Expand Down

0 comments on commit 329d918

Please sign in to comment.