From a15cd11a4a42ad5c36d716c21f660988603e1ff6 Mon Sep 17 00:00:00 2001 From: carlpartridge Date: Tue, 11 Feb 2025 15:36:32 -0500 Subject: [PATCH] Change name of output to avoid conflict --- .github/workflows/ci-checks.yml | 8 ++++---- unit_test.sh | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index 1255296..73dd85f 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -71,8 +71,8 @@ jobs: - name: Archive code coverage results uses: actions/upload-artifact@v4 with: - name: code-coverage-report - path: ./test_results/latest/testcoverage.out + name: code-coverage-report-ssas + path: ./test_results/latest/testcoverage-ssas.out sonar-quality-gate: name: Sonarqube Quality Gate @@ -83,7 +83,7 @@ jobs: - name: Download code coverage uses: actions/download-artifact@v4 with: - name: code-coverage-report + name: code-coverage-report-ssas - name: Set env vars from AWS params uses: cmsgov/ab2d-bcda-dpc-platform/actions/aws-params-env-action@main env: @@ -99,7 +99,7 @@ jobs: -Dsonar.projectKey=bcda-ssas-api -Dsonar.sources=. -Dsonar.working.directory=./sonar_workspace - -Dsonar.go.coverage.reportPaths=./test_results/latest/testcoverage.out + -Dsonar.go.coverage.reportPaths=./test_results/latest/testcoverage-ssas.out -Dsonar.coverage.exclusions=**/*test.go,**/test/**/*,**/testUtils/*,**/scripts/*,**/ops/*,**/mock*.go,**/mock/**/* -Dsonar.branch.name=${{ github.event.pull_request.head.ref }} -Dsonar.projectVersion=${{ github.event.pull_request.head.sha }} diff --git a/unit_test.sh b/unit_test.sh index ce172f6..a425830 100755 --- a/unit_test.sh +++ b/unit_test.sh @@ -31,10 +31,10 @@ DATABASE_URL=$TEST_DB_URL DEBUG=true go run github.com/CMSgov/bcda-ssas-app/ssas echo "Successfully loaded SSAS fixture data" echo "Running SSAS unit tests and placing results/coverage in test_results/${timestamp} on host..." -DATABASE_URL=$TEST_DB_URL QUEUE_DATABASE_URL=$TEST_DB_URL gotestsum --debug --junitfile test_results/${timestamp}/junit.xml -- -cover -coverpkg ./... -p 1 -race ./ssas/... -coverprofile test_results/${timestamp}/testcoverage.out 2>&1 | tee test_results/${timestamp}/testresults.out -go tool cover -func test_results/${timestamp}/testcoverage.out > test_results/${timestamp}/testcov_byfunc.out +DATABASE_URL=$TEST_DB_URL QUEUE_DATABASE_URL=$TEST_DB_URL gotestsum --debug --junitfile test_results/${timestamp}/junit.xml -- -cover -coverpkg ./... -p 1 -race ./ssas/... -coverprofile test_results/${timestamp}/testcoverage-ssas.out 2>&1 | tee test_results/${timestamp}/testresults.out +go tool cover -func test_results/${timestamp}/testcoverage-ssas.out > test_results/${timestamp}/testcov_byfunc.out echo TOTAL COVERAGE: $(tail -1 test_results/${timestamp}/testcov_byfunc.out | head -1) -go tool cover -html=test_results/${timestamp}/testcoverage.out -o test_results/${timestamp}/testcoverage.html +go tool cover -html=test_results/${timestamp}/testcoverage-ssas.out -o test_results/${timestamp}/testcoverage.html cp test_results/${timestamp}/* test_results/latest echo "Cleaning up test DB (ssas_test)..." usql $DB_HOST_URL -c 'drop database ssas_test;'