@@ -68,50 +68,14 @@ jobs:
6868 CX_TENANT : ${{ secrets.CX_TENANT }}
6969 CX_APIKEY : ${{ secrets.CX_APIKEY }}
7070
71- - name : Print filtered coverage percentage
71+ - name : Print total coverage percentage
7272 run : |
73- COVERED_LINES=$(xmllint --xpath "sum(//report/package[
74- not(starts-with(@name, 'com.checkmarx.ast.results')) and
75- not(starts-with(@name, 'com.checkmarx.ast.kicsRealtimeResults')) and
76- not(starts-with(@name, 'com.checkmarx.ast.asca')) and
77- not(starts-with(@name, 'com.checkmarx.ast.learnMore')) and
78- not(starts-with(@name, 'com.checkmarx.ast.predicate')) and
79- not(starts-with(@name, 'com.checkmarx.ast.scan')) and
80- not(starts-with(@name, 'com.checkmarx.ast.codebashing')) and
81- not(starts-with(@name, 'com.checkmarx.ast.remediation')) and
82- not(starts-with(@name, 'com.checkmarx.ast.project')) and
83- not(starts-with(@name, 'com.checkmarx.ast.tenant')) and
84- not(starts-with(@name, 'com.checkmarx.ast.wrapper.Execution'))
85- ]/counter[@type='LINE']/@covered)" target/site/jacoco/jacoco.xml)
86-
87- MISSED_LINES=$(xmllint --xpath "sum(//report/package[
88- not(starts-with(@name, 'com.checkmarx.ast.results')) and
89- not(starts-with(@name, 'com.checkmarx.ast.kicsRealtimeResults')) and
90- not(starts-with(@name, 'com.checkmarx.ast.asca')) and
91- not(starts-with(@name, 'com.checkmarx.ast.learnMore')) and
92- not(starts-with(@name, 'com.checkmarx.ast.predicate')) and
93- not(starts-with(@name, 'com.checkmarx.ast.scan')) and
94- not(starts-with(@name, 'com.checkmarx.ast.codebashing')) and
95- not(starts-with(@name, 'com.checkmarx.ast.remediation')) and
96- not(starts-with(@name, 'com.checkmarx.ast.project')) and
97- not(starts-with(@name, 'com.checkmarx.ast.tenant')) and
98- not(starts-with(@name, 'com.checkmarx.ast.wrapper.Execution'))
99- ]/counter[@type='LINE']/@missed)" target/site/jacoco/jacoco.xml)
100-
101- if [ -z "$COVERED_LINES" ] || [ -z "$MISSED_LINES" ]; then
102- echo "Error: Could not extract coverage data from jacoco.xml"
103- exit 1
104- fi
105-
73+ COVERED_LINES=$(xmllint --xpath "string(//report/counter[@type='LINE']/@covered)" target/site/jacoco/jacoco.xml)
74+ MISSED_LINES=$(xmllint --xpath "string(//report/counter[@type='LINE']/@missed)" target/site/jacoco/jacoco.xml)
10675 TOTAL_LINES=$((COVERED_LINES + MISSED_LINES))
107-
108- if [ "$TOTAL_LINES" -eq 0 ]; then
109- COVERAGE_PERCENTAGE=0
110- else
111- COVERAGE_PERCENTAGE=$(echo "scale=2; $COVERED_LINES / $TOTAL_LINES * 100" | bc)
112- fi
113-
114- echo "Filtered coverage percentage: $COVERAGE_PERCENTAGE%"
76+ COVERAGE_PERCENTAGE=$(echo "scale=2; $COVERED_LINES / $TOTAL_LINES * 100" | bc)
77+ echo "Total coverage percentage: $COVERAGE_PERCENTAGE%"
78+
11579
11680
11781
0 commit comments