From ad76fd8c561d72861b97c89d7509ac201bf78b86 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Fri, 12 Apr 2024 13:53:55 +0200 Subject: [PATCH] Support logging of sub scores. --- action.yml | 2 +- doc/dependency-graph.puml | 4 ++-- pom.xml | 4 ++-- .../github/QualityMonitorDockerITest.java | 20 +++++++++++-------- .../grading/github/QualityMonitorITest.java | 15 ++++++++------ 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/action.yml b/action.yml index e887f47..b7f7082 100644 --- a/action.yml +++ b/action.yml @@ -25,7 +25,7 @@ inputs: required: false runs: using: 'docker' - image: 'docker://uhafner/quality-monitor:1.7.0-SNAPSHOT' + image: 'docker://uhafner/quality-monitor:1.7.0' env: CONFIG: ${{ inputs.config }} CHECKS_NAME: ${{ inputs.checks-name }} diff --git a/doc/dependency-graph.puml b/doc/dependency-graph.puml index 13c71c7..9cc9569 100644 --- a/doc/dependency-graph.puml +++ b/doc/dependency-graph.puml @@ -42,7 +42,7 @@ rectangle "jackson-databind\n\n2.17.0" as com_fasterxml_jackson_core_jackson_dat rectangle "jackson-annotations\n\n2.17.0" as com_fasterxml_jackson_core_jackson_annotations_jar rectangle "jackson-core\n\n2.17.0" as com_fasterxml_jackson_core_jackson_core_jar rectangle "byte-buddy\n\n1.14.13" as net_bytebuddy_byte_buddy_jar -rectangle "quality-monitor\n\n1.7.0-SNAPSHOT" as edu_hm_hafner_quality_monitor_jar +rectangle "quality-monitor\n\n1.7.0" as edu_hm_hafner_quality_monitor_jar rectangle "github-api\n\n1.321" as org_kohsuke_github_api_jar rectangle "spotbugs-annotations\n\n4.8.3" as com_github_spotbugs_spotbugs_annotations_jar rectangle "error_prone_annotations\n\n2.26.1" as com_google_errorprone_error_prone_annotations_jar @@ -101,4 +101,4 @@ edu_hm_hafner_quality_monitor_jar -[#000000]-> edu_hm_hafner_codingstyle_jar edu_hm_hafner_quality_monitor_jar -[#000000]-> org_apache_commons_commons_lang3_jar edu_hm_hafner_quality_monitor_jar -[#000000]-> commons_io_commons_io_jar edu_hm_hafner_quality_monitor_jar -[#000000]-> net_bytebuddy_byte_buddy_jar -@enduml \ No newline at end of file +@enduml diff --git a/pom.xml b/pom.xml index 0a16e85..2cf7ec9 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ edu.hm.hafner quality-monitor - 1.7.0-SNAPSHOT + 1.7.0 jar @@ -29,7 +29,7 @@ 17 - 3.29.0 + 3.30.0 1.321 1.19.7 diff --git a/src/test/java/edu/hm/hafner/grading/github/QualityMonitorDockerITest.java b/src/test/java/edu/hm/hafner/grading/github/QualityMonitorDockerITest.java index 8fa424d..c6020c5 100644 --- a/src/test/java/edu/hm/hafner/grading/github/QualityMonitorDockerITest.java +++ b/src/test/java/edu/hm/hafner/grading/github/QualityMonitorDockerITest.java @@ -16,7 +16,8 @@ import static org.assertj.core.api.Assertions.*; /** - * Integration test for the grading action. Starts the container and checks if the grading runs as expected. + * Integration test for the quality monitor action. + * Starts the container and checks if the action runs as expected. * * @author Ullrich Hafner */ @@ -120,13 +121,16 @@ void shouldGradeInDockerContainer() throws TimeoutException, IOException { .contains(new String[] { "Processing 1 test configuration(s)", "-> Unittests Total: TESTS: 1 tests", + "=> Unittests: 1 tests passed", "=> JUnit: 1 tests passed", "Processing 2 coverage configuration(s)", "-> Line Coverage Total: LINE: 10.93% (33/302)", + "=> Line Coverage: 11% (269 missed lines)", "-> Branch Coverage Total: BRANCH: 9.52% (4/42)", - "> JaCoCo: 10% coverage achieved", + "=> Branch Coverage: 10% (38 missed branches)", + "=> JaCoCo: 10% (307 missed items)", "-> Mutation Coverage Total: MUTATION: 7.86% (11/140)", - "=> PIT: 8% mutations killed", + "=> PIT: 8% (129 survived mutations)", "Processing 2 static analysis configuration(s)", "-> CheckStyle Total: 1 warnings", "-> PMD Total: 1 warnings", @@ -154,9 +158,9 @@ void shouldUseDefaultConfiguration() throws TimeoutException { "Processing 2 coverage configuration(s)", "-> Line Coverage Total: LINE: 10.93% (33/302)", "-> Branch Coverage Total: BRANCH: 9.52% (4/42)", - "=> Code Coverage: 10% coverage achieved", + "=> Code Coverage: 10%", "-> Mutation Coverage Total: MUTATION: 7.86% (11/140)", - "=> Mutation Coverage: 8% mutations killed", + "=> Mutation Coverage: 8% ", "Processing 2 static analysis configuration(s)", "-> CheckStyle Total: 1 warnings", "-> PMD Total: 1 warnings", @@ -177,10 +181,10 @@ void shouldShowErrors() throws TimeoutException { "Configuration error for 'Tests'?", "=> Tests: 0 tests passed", "Processing 2 coverage configuration(s)", - "=> Code Coverage: 0% coverage achieved", + "=> Code Coverage: 0%", "Configuration error for 'Line Coverage'?", "Configuration error for 'Branch Coverage'?", - "=> Mutation Coverage: 0% mutations killed", + "=> Mutation Coverage: 0%", "Configuration error for 'Mutation Coverage'?", "Processing 2 static analysis configuration(s)", "Configuration error for 'CheckStyle'?", @@ -195,7 +199,7 @@ void shouldShowErrors() throws TimeoutException { } private GenericContainer createContainer() { - return new GenericContainer<>(DockerImageName.parse("uhafner/quality-monitor:1.7.0-SNAPSHOT")); + return new GenericContainer<>(DockerImageName.parse("uhafner/quality-monitor:1.7.0")); } private String readStandardOut(final GenericContainer> container) throws TimeoutException { diff --git a/src/test/java/edu/hm/hafner/grading/github/QualityMonitorITest.java b/src/test/java/edu/hm/hafner/grading/github/QualityMonitorITest.java index d3db551..e99f1c6 100644 --- a/src/test/java/edu/hm/hafner/grading/github/QualityMonitorITest.java +++ b/src/test/java/edu/hm/hafner/grading/github/QualityMonitorITest.java @@ -105,8 +105,10 @@ void shouldMonitorQualityWithDefaultConfiguration() { "Processing 2 coverage configuration(s)", "\"coveredPercentageImpact\" : 0,", "\"missedPercentageImpact\" : 0,", - "=> Code Coverage: 0% coverage achieved", - "=> Mutation Coverage: 0% mutations killed", + "=> Line Coverage: 0% (0 missed lines)", + "=> Branch Coverage: 0% (0 missed branches)", + "=> Code Coverage: 0% (0 missed items)", + "=> Mutation Coverage: 0% (0 survived mutations)", "Processing 2 static analysis configuration(s)", "\"errorImpact\" : 0,", "\"highImpact\" : 0,", @@ -127,15 +129,16 @@ void shouldGradeWithConfigurationFromEnvironment() { "Processing 2 coverage configuration(s)", "-> Line Coverage Total: LINE: 10.93% (33/302)", "-> Branch Coverage Total: BRANCH: 9.52% (4/42)", - "=> JaCoCo: 10% coverage achieved", + "=> JaCoCo: 10%", "-> Mutation Coverage Total: MUTATION: 7.86% (11/140)", - "=> PIT: 8% mutations killed", + "=> PIT: 8%", "Processing 2 static analysis configuration(s)", "-> CheckStyle Total: 19 warnings", + "=> CheckStyle: 19 warnings found (0 error, 0 high, 19 normal, 0 low)", "-> PMD Total: 41 warnings", - "=> Style: 60 warnings found (0 error, 0 high, 60 normal, 0 low)", + "=> PMD: 41 warnings found (0 error, 0 high, 41 normal, 0 low)", "-> SpotBugs Total: 1 warnings", - "=> Bugs: 1 warning found (0 error, 0 high, 0 normal, 1 low)", + "=> SpotBugs: 1 warning found (0 error, 0 high, 0 normal, 1 low)", "mutation=8", "bugs=1", "tests=37",