Skip to content

Commit

Permalink
(#3032) Try to fix code coverage reports
Browse files Browse the repository at this point in the history
  • Loading branch information
squaregoldfish committed Jan 21, 2025
1 parent f150ebb commit 292bb18
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle_junit_CalcCoeffEdit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle_junit_ExtStdEdit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle_junit_SensorCalibEdit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle_junit_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
57 changes: 57 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -168,27 +168,84 @@ 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 {
includeTestsMatching "uk.ac.exeter.QuinCe.web.Instrument.SensorCalibrationsBeanMultipleEditTest"
}
}

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 {
includeTestsMatching "uk.ac.exeter.QuinCe.web.Instrument.CalculationCoefficientsBeanMultipleEditTest"
}
}

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 {
includeTestsMatching "uk.ac.exeter.QuinCe.web.Instrument.ExternalStandardsBeanMultipleEditTest"
}
}

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 {
Expand Down

0 comments on commit 292bb18

Please sign in to comment.