Skip to content

Commit

Permalink
ci_: bring back cmd coverage (#6204)
Browse files Browse the repository at this point in the history
* ci_: bring back cmd coverage

* fix_: update jenkinsfile
  • Loading branch information
igor-sirotin authored Dec 12, 2024
1 parent 1795620 commit 137698e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
3 changes: 1 addition & 2 deletions _assets/ci/Jenkinsfile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ pipeline {
]) {
nix.shell('make test-unit V=1', pure: false)
}
sh "mv c.out test-coverage.out"
archiveArtifacts('report_*.xml, test_*.log, test-coverage.out, test-coverage.html, coverage_merged.out')
archiveArtifacts('report_*.xml, test_*.log, test-coverage.html')
}
}
} }
Expand Down
11 changes: 3 additions & 8 deletions _assets/scripts/run_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,17 @@ fi

# Gather test coverage results
merged_coverage_report="coverage_merged.out"
final_coverage_report="c.out"
coverage_reports=$(find . -iname "*.coverage.out")
rm -f ${final_coverage_report} ${merged_coverage_report}
rm -f ${merged_coverage_report}

echo -e "${GRN}Gathering test coverage results: ${RST} output: ${merged_coverage_report}, input: ${coverage_reports}"
echo $coverage_reports | xargs go run ./cmd/test-coverage-utils/gocovmerge.go > ${merged_coverage_report}

# Filter out test coverage for packages in ./cmd
echo -e "${GRN}Filtering test coverage packages:${RST} ./cmd"
grep -v '^github.com/status-im/status-go/cmd/' ${merged_coverage_report} > ${final_coverage_report}

# Generate HTML coverage report
convert_coverage_to_html ${final_coverage_report} "test-coverage.html"
convert_coverage_to_html ${merged_coverage_report} "test-coverage.html"

if [[ $UNIT_TEST_REPORT_CODECOV == 'true' ]]; then
report_to_codecov "report_*.xml" ${final_coverage_report} "unit"
report_to_codecov "report_*.xml" ${merged_coverage_report} "unit"
fi

# Generate report with test stats
Expand Down

0 comments on commit 137698e

Please sign in to comment.