Skip to content

Commit f1c5234

Browse files
committed
Import the JUnit XML that eclipseTest writes
TeamCity shows no test names for eclipseTest. A failed run is just a bare Gradle exception in the UI. eclipseTest is not a Gradle Test task, so the Gradle runner's own test listener never sees it. From eclipse-buildship#1375 on it writes JUnit XML again, so pick that up with the XML report processing feature. The rules are narrow on purpose. A wildcard over test-results would also match what a real Test task produces, and the runner already reports those, so every such test would show up twice. The sanity check runs no tests and is left out, so that "no reports found" in a build log always means something went wrong.
1 parent a2f25b4 commit f1c5234

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎.teamcity/Buildship/Project.kt‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package Buildship
22

33
import jetbrains.buildServer.configs.kotlin.v2019_2.*
44
import jetbrains.buildServer.configs.kotlin.v2019_2.Project
5+
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.XmlReport
6+
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.xmlReport
57
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle
68
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.*
79
import jetbrains.buildServer.configs.kotlin.v2019_2.vcs.GitVcsRoot
@@ -141,6 +143,18 @@ class IndividualScenarioBuildType(type: ScenarioType, os: OS, eclipseVersion: Ec
141143
}
142144
}
143145

146+
if (type.runsTests) {
147+
features {
148+
xmlReport {
149+
reportType = XmlReport.XmlReportType.JUNIT
150+
rules = """
151+
+:**/build/test-results/eclipseTest/*.xml
152+
+:**/build/test-results/crossVersionEclipseTest/*.xml
153+
""".trimIndent()
154+
}
155+
}
156+
}
157+
144158
steps {
145159
gradle {
146160
name = "RUNNER_21"

‎.teamcity/Buildship/ScenarioType.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package Buildship
22

3-
enum class ScenarioType(val gradleTasks: String) {
4-
SANITY_CHECK("assemble checkstyleMain"),
3+
enum class ScenarioType(val gradleTasks: String, val runsTests: Boolean = true) {
4+
SANITY_CHECK("assemble checkstyleMain", runsTests = false),
55
BASIC_COVERAGE("clean eclipseTest"),
66
FULL_COVERAGE("clean build"),
77
CROSS_VERSION("clean crossVersionEclipseTest")

0 commit comments

Comments
 (0)