Skip to content
Snippets Groups Projects
Commit 696b99ed authored by Colin DAMON's avatar Colin DAMON
Browse files

Fix coverage calculations

parent c26bb01a
No related branches found
No related tags found
1 merge request!37Resolve "TCR Roman Numerals"
...@@ -14,7 +14,7 @@ stages: ...@@ -14,7 +14,7 @@ stages:
- cd $PROJECT_FOLDER - cd $PROJECT_FOLDER
script: script:
- mvn $MAVEN_CLI_OPTS clean package - mvn $MAVEN_CLI_OPTS clean package
- awk -F"," '{ branches += $6 + $7; covered += $7 } END { print covered, "/", branches, "branches covered"; print 100*covered/branches, "%covered" }' target/site/jacoco/jacoco.csv - awk -F"," '{ branches += $4 + $5 + $6 + $7; covered += $5 + $7 } END { print covered, "/", branches, "branches covered"; print 100*covered/branches, "%covered" }' target/site/jacoco/jacoco.csv
artifacts: artifacts:
reports: reports:
junit: $PROJECT_FOLDER/target/surefire-reports/TEST-*.xml junit: $PROJECT_FOLDER/target/surefire-reports/TEST-*.xml
...@@ -35,7 +35,7 @@ stages: ...@@ -35,7 +35,7 @@ stages:
- cd $PROJECT_FOLDER - cd $PROJECT_FOLDER
script: script:
- ./mvnw -B -Pprod,swagger verify - ./mvnw -B -Pprod,swagger verify
- awk -F"," '{ branches += $6 + $7; covered += $7 } END { print covered, "/", branches, "branches covered"; print 100*covered/branches, "%covered" }' target/jacoco-aggregate/jacoco.csv - awk -F"," '{ branches += $4 + $5 + $6 + $7; covered += $5 + $7 } END { print covered, "/", branches, "branches covered"; print 100*covered/branches, "%covered" }' target/jacoco-aggregate/jacoco.csv
artifacts: artifacts:
reports: reports:
junit: $PROJECT_FOLDER/target/test-results/**/TEST-*.xml junit: $PROJECT_FOLDER/target/test-results/**/TEST-*.xml
......
package-java-pagination-seven: package-tcr-roman-numerals:
variables: variables:
PROJECT_FOLDER: "tcr-roman-numerals" PROJECT_FOLDER: "tcr-roman-numerals"
extends: .java extends: .java
......
...@@ -9,6 +9,8 @@ import java.util.function.Function; ...@@ -9,6 +9,8 @@ import java.util.function.Function;
public class Numerals { public class Numerals {
private static final NavigableMap<Integer, String> CONVERSIONS = buildConversions(); private static final NavigableMap<Integer, String> CONVERSIONS = buildConversions();
private Numerals() {}
public static String toRoman(int arabic) { public static String toRoman(int arabic) {
return highestKnownConversion(arabic).map(toRomanRepresentation(arabic)).orElse(""); return highestKnownConversion(arabic).map(toRomanRepresentation(arabic)).orElse("");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment