Skip to content
Snippets Groups Projects
Commit a5dc9daa authored by René Schöne's avatar René Schöne
Browse files

fix jacoco

parent 51bb3674
Branches
No related tags found
1 merge request!9Resolve "Split tests into service-based and normal tests"
Pipeline #8807 passed with warnings
...@@ -14,7 +14,7 @@ variables: ...@@ -14,7 +14,7 @@ variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false" GRADLE_OPTS: "-Dorg.gradle.daemon=false"
TEST_REPORTS: "eraser-base/build/reports/tests/" TEST_REPORTS: "eraser-base/build/reports/tests/"
TEST_LOG: "eraser-base/logs/eraser-test.log" TEST_LOG: "eraser-base/logs/eraser-test.log"
JACOCO_REPORT: "eraser-base/build/reports/jacoco/test/jacocoTestReport.xml" JACOCO_REPORT: "*/build/reports/jacoco/all-tests/jacocoTestReport.xml"
# settings for influxdb # settings for influxdb
INFLUXDB_DB: "jastaddHistory" INFLUXDB_DB: "jastaddHistory"
INFLUXDB_USER: "root" INFLUXDB_USER: "root"
...@@ -32,7 +32,7 @@ build: ...@@ -32,7 +32,7 @@ build:
image: openjdk:8 image: openjdk:8
stage: build stage: build
script: script:
- ./gradlew --console=plain --build-cache assemble - ./gradlew --console=plain assemble
artifacts: artifacts:
paths: paths:
- "eraser-base/src/gen" - "eraser-base/src/gen"
...@@ -50,7 +50,7 @@ test: ...@@ -50,7 +50,7 @@ test:
needs: needs:
- build - build
script: script:
- ./gradlew --continue --console=plain --info allTests jacocoTestReport - ./gradlew --console=plain --info allTests
artifacts: artifacts:
when: always when: always
paths: paths:
......
...@@ -2,6 +2,7 @@ plugins { ...@@ -2,6 +2,7 @@ plugins {
id 'java' id 'java'
id 'idea' id 'idea'
id 'com.github.ben-manes.versions' id 'com.github.ben-manes.versions'
id 'jacoco'
} }
repositories { repositories {
...@@ -30,3 +31,19 @@ task allTests(type: Test, dependsOn: testClasses) { ...@@ -30,3 +31,19 @@ task allTests(type: Test, dependsOn: testClasses) {
includeTags 'mqtt | influx' includeTags 'mqtt | influx'
} }
} }
// extension for all Test tasks similar to https://stackoverflow.com/a/57330075/2493208
jacocoTestReport {
executionData tasks.withType(Test).findAll { it.state.executed }
getExecutionData().setFrom(fileTree(buildDir).include("/jacoco/*.exec"))
reports {
xml.enabled true
xml.destination(file("${jacoco.reportsDir}/all-tests/jacocoAllTestReport.xml"))
html.enabled false
}
}
tasks.withType(Test) {
finalizedBy jacocoTestReport
}
...@@ -9,7 +9,6 @@ buildscript { ...@@ -9,7 +9,6 @@ buildscript {
plugins { plugins {
id 'eraser.java-application-conventions' id 'eraser.java-application-conventions'
id 'eraser.java-jastadd-conventions' id 'eraser.java-jastadd-conventions'
id 'jacoco'
} }
apply plugin: 'jastadd' apply plugin: 'jastadd'
...@@ -30,16 +29,6 @@ application { ...@@ -30,16 +29,6 @@ application {
mainClass = 'de.tudresden.inf.st.eraser.Main' mainClass = 'de.tudresden.inf.st.eraser.Main'
} }
// extension for all Test tasks similar to https://stackoverflow.com/a/57330075/2493208
jacocoTestReport {
executionData tasks.withType(Test).findAll { it.state.executed }
reports {
xml.enabled true
xml.destination(file("${jacoco.reportsDir}/all-tests/jacocoAllTestReport.xml"))
html.enabled false
}
}
def relastFiles = fileTree('src/main/jastadd/') { def relastFiles = fileTree('src/main/jastadd/') {
include '**/*.relast' }.toList().toArray() include '**/*.relast' }.toList().toArray()
String[] relastArguments = [ String[] relastArguments = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment