mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform UI][se] IJPL-198632 Tests for duplicated actions: report each action as a separate test
GitOrigin-RevId: cb0fc813721d87740cf2f35c95be3b5d9a67c9b5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b74957ee70
commit
8e086d14f3
@@ -7,15 +7,24 @@ import java.util.*
|
||||
// Functions in this file only handle TeamCity message formatting.
|
||||
|
||||
fun PrintStream.reportTestFailure(testName: String, message: String, details: String) {
|
||||
reportTest(testName, message, details, true)
|
||||
}
|
||||
|
||||
fun PrintStream.reportTestSuccess(testName: String, message: String = "", details: String = "") {
|
||||
reportTest(testName, message, details, false)
|
||||
}
|
||||
|
||||
private fun PrintStream.reportTest(testName: String, message: String, details: String, isFailure: Boolean) {
|
||||
val flowId = UUID.randomUUID().toString()
|
||||
val escapedTestName = testName.escapeStringForTeamCity()
|
||||
val escapedMessage = message.escapeStringForTeamCity()
|
||||
val escapedDetails = details.escapeStringForTeamCity()
|
||||
println("""
|
||||
##teamcity[testStarted flowId='$flowId' name='$escapedTestName' nodeId='$escapedTestName' parentNodeId='0']
|
||||
##teamcity[testFailed flowId='$flowId' name='$escapedTestName' nodeId='$escapedTestName' parentNodeId='0' message='$escapedMessage' details='$escapedDetails']
|
||||
##teamcity[testFinished flowId='$flowId' name='$escapedTestName' nodeId='$escapedTestName' parentNodeId='0']
|
||||
""".trimIndent())
|
||||
|
||||
println(buildString {
|
||||
appendLine("##teamcity[testStarted flowId='$flowId' name='$escapedTestName' nodeId='$escapedTestName' parentNodeId='0']")
|
||||
if (isFailure) appendLine("##teamcity[testFailed flowId='$flowId' name='$escapedTestName' nodeId='$escapedTestName' parentNodeId='0' message='$escapedMessage' details='$escapedDetails']")
|
||||
appendLine("##teamcity[testFinished flowId='$flowId' name='$escapedTestName' nodeId='$escapedTestName' parentNodeId='0']")
|
||||
})
|
||||
}
|
||||
|
||||
fun String.escapeStringForTeamCity(): String {
|
||||
|
||||
Reference in New Issue
Block a user