From 292bb183a90311ce8ac9bdadbbfb8a669024d63a Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Tue, 21 Jan 2025 17:26:12 +0100 Subject: [PATCH] (#3032) Try to fix code coverage reports --- .../workflows/gradle_junit_CalcCoeffEdit.yml | 2 +- .github/workflows/gradle_junit_ExtStdEdit.yml | 2 +- .../gradle_junit_SensorCalibEdit.yml | 2 +- .github/workflows/gradle_junit_main.yml | 2 +- build.gradle | 57 +++++++++++++++++++ 5 files changed, 61 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gradle_junit_CalcCoeffEdit.yml b/.github/workflows/gradle_junit_CalcCoeffEdit.yml index bd395a73e..21bc28e3b 100644 --- a/.github/workflows/gradle_junit_CalcCoeffEdit.yml +++ b/.github/workflows/gradle_junit_CalcCoeffEdit.yml @@ -14,7 +14,7 @@ jobs: with: java-version: 17 - name: Run CalculationCoefficientsBean multiple edit tests - run: ./gradlew calculationCoefficientsBeanEditTest jacocoTestReport + run: ./gradlew calculationCoefficientsBeanEditTest calculationCoefficientsBeanEditTestReport - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: diff --git a/.github/workflows/gradle_junit_ExtStdEdit.yml b/.github/workflows/gradle_junit_ExtStdEdit.yml index a242cb388..d1da00d48 100644 --- a/.github/workflows/gradle_junit_ExtStdEdit.yml +++ b/.github/workflows/gradle_junit_ExtStdEdit.yml @@ -14,7 +14,7 @@ jobs: with: java-version: 17 - name: Run ExternalStandardsBean multiple edit tests - run: ./gradlew externalStandardsBeanEditTest jacocoTestReport + run: ./gradlew externalStandardsBeanEditTest externalStandardsBeanEditTestReport - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: diff --git a/.github/workflows/gradle_junit_SensorCalibEdit.yml b/.github/workflows/gradle_junit_SensorCalibEdit.yml index 95a5a7293..3a27a8f34 100644 --- a/.github/workflows/gradle_junit_SensorCalibEdit.yml +++ b/.github/workflows/gradle_junit_SensorCalibEdit.yml @@ -14,7 +14,7 @@ jobs: with: java-version: 17 - name: Run SensorCalibrationsBean multiple edit tests - run: ./gradlew sensorCalibrationsBeanEditTest jacocoTestReport + run: ./gradlew sensorCalibrationsBeanEditTest sensorCalibrationsBeanEditTestReport - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: diff --git a/.github/workflows/gradle_junit_main.yml b/.github/workflows/gradle_junit_main.yml index 33e6bad57..5abb1384d 100644 --- a/.github/workflows/gradle_junit_main.yml +++ b/.github/workflows/gradle_junit_main.yml @@ -14,7 +14,7 @@ jobs: with: java-version: 17 - name: Run small JUnit tests - run: ./gradlew testSmall jacocoTestReport + run: ./gradlew testSmall testSmallReport - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: diff --git a/build.gradle b/build.gradle index f3d7bc0b8..103dae877 100644 --- a/build.gradle +++ b/build.gradle @@ -168,6 +168,20 @@ task testSmall(type: Test) { } } +task testSmallReport(type: JacocoReport) { + dependsOn testSmall + + reports { + xml.required = true + xml.destination = file("${buildDir}/reports/jacoco/report.xml") + csv.required = false + html.required = false + } + + sourceSets sourceSets.main + executionData testSmall +} + task sensorCalibrationsBeanEditTest(type: Test) { useJUnitPlatform() filter { @@ -175,6 +189,20 @@ task sensorCalibrationsBeanEditTest(type: Test) { } } +task sensorCalibrationsBeanEditTestReport(type: JacocoReport) { + dependsOn sensorCalibrationsBeanEditTest + + reports { + xml.required = true + xml.destination = file("${buildDir}/reports/jacoco/report.xml") + csv.required = false + html.required = false + } + + sourceSets sourceSets.main + executionData sensorCalibrationsBeanEditTest +} + task calculationCoefficientsBeanEditTest(type: Test) { useJUnitPlatform() filter { @@ -182,6 +210,20 @@ task calculationCoefficientsBeanEditTest(type: Test) { } } +task calculationCoefficientsBeanEditTestReport(type: JacocoReport) { + dependsOn calculationCoefficientsBeanEditTest + + reports { + xml.required = true + xml.destination = file("${buildDir}/reports/jacoco/report.xml") + csv.required = false + html.required = false + } + + sourceSets sourceSets.main + executionData calculationCoefficientsBeanEditTest +} + task externalStandardsBeanEditTest(type: Test) { useJUnitPlatform() filter { @@ -189,6 +231,21 @@ task externalStandardsBeanEditTest(type: Test) { } } +task externalStandardsBeanEditTestReport(type: JacocoReport) { + dependsOn externalStandardsBeanEditTest + + reports { + xml.required = true + xml.destination = file("${buildDir}/reports/jacoco/report.xml") + csv.required = false + html.required = false + } + + sourceSets sourceSets.main + executionData externalStandardsBeanEditTest +} + + eclipse { wtp { facet {