From 16161025f2393999bbea2b23180bc335e38ec623 Mon Sep 17 00:00:00 2001 From: Matthew Jaffee Date: Fri, 7 Jan 2022 15:59:54 -0600 Subject: [PATCH] trying to get sonar coverage reporting working looks like test-report.out and coverage.out aren't about the same tests. I'm unclear on how sonar uses tests.reportPaths vs coverage.reportPaths, but figured I'd try at least generating them from the same run to see if that helped. --- .gitlab/.gitlab-ci.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 5f65fc704..c0e279b47 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -90,21 +90,10 @@ run go tests future: script: - echo "Running featurebase unit tests..." - PKG_LIST=$(go list ./... | grep -v internal/clustertests | paste -s -d, -) - - go test -coverprofile=coverage.out -covermode=atomic -coverpkg=${PKG_LIST} ./... + - go test -json -coverprofile=coverage.out -covermode=atomic -coverpkg=${PKG_LIST} ./... | tee test-report.out artifacts: paths: - coverage.out - -run go tests with output: - stage: test - image: golang:$GOVERSION - rules: - - if: '$CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"' - script: - - echo "Running featurebase unit tests to capture JSON output..." - - go test -json > test-report.out - artifacts: - paths: - test-report.out upload to sonarcloud: @@ -118,7 +107,6 @@ upload to sonarcloud: - sonar-scanner -Dsonar.projectKey=molecula_featurebase -Dsonar.organization=molecula -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.go.coverage.reportPaths=coverage.out -Dsonar.go.tests.reportPaths=test-report.out -Dsonar.javascript.lcov.reportPaths=lattice/coverage/lcov.info needs: - job: run go tests - - job: run go tests with output - job: run jest tests build for linux amd64: