Skip to content

Commit

Permalink
Cleaner code
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Nov 9, 2024
1 parent c3c984f commit 11d2a82
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/java/main/org/wikipathways/curator/CheckRDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,13 @@ public static void main(String[] args) throws Exception {
reportJSON.println(" \"label\": \"curation\",");
double ratio = (double)failedAssertions.size() / (double)assertions.size();
// reportJSON.println(" \"ratio\": \"" + ratio + "\",");
if (ratio > 0.05) {
if (anyTestClassHasFails) {
String color = "yellow";
if (ratio > 0.05) { color = "red"; }
else if (ratio > 0.01) { color = "orange"; };
reportStatus.println("status=⨯");
reportJSON.println(" \"message\": \"" + failedAssertions.size() + " errors\",");
reportJSON.println(" \"color\": \"red\"");
} else if (ratio > 0.01) {
reportStatus.println("status=⨯");
reportJSON.println(" \"message\": \"" + failedAssertions.size() + " errors\",");
reportJSON.println(" \"color\": \"orange\"");
} else if (anyTestClassHasFails) {
reportStatus.println("status=⨯");
reportJSON.println(" \"message\": \"" + failedAssertions.size() + " errors\",");
reportJSON.println(" \"color\": \"yellow\"");
reportJSON.println(" \"color\": \"" + color + "\"");
} else {
reportStatus.println("status=✓");
reportJSON.println(" \"message\": \"success\",");
Expand Down

0 comments on commit 11d2a82

Please sign in to comment.