mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
[aggregator] IDEA-310927 enriching test result data with is_muted field
GitOrigin-RevId: c7fe54c2ff06daf92413907d4791e8dafc02be05
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2e3a15bf54
commit
2fff5cfdbe
@@ -38,7 +38,8 @@ class NastradamusClient(
|
||||
runOrder = json.findValue("runOrder").asInt(),
|
||||
duration = json.findValue("duration")?.asLong() ?: 0,
|
||||
buildType = teamCityClient.buildTypeId,
|
||||
buildStatusMessage = teamCityClient.getBuildInfo().findValue("statusText").asText()
|
||||
buildStatusMessage = teamCityClient.getBuildInfo().findValue("statusText").asText(),
|
||||
isMuted = json.findValue("currentlyMuted")?.asBoolean() ?: false
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -31,5 +31,8 @@ data class TestResultEntity(
|
||||
val buildType: String,
|
||||
|
||||
@JsonProperty("build_status_message")
|
||||
val buildStatusMessage: String
|
||||
val buildStatusMessage: String,
|
||||
|
||||
@JsonProperty("is_muted")
|
||||
val isMuted: Boolean,
|
||||
)
|
||||
|
||||
@@ -192,7 +192,7 @@ class TeamCityClient(
|
||||
do {
|
||||
val fullUrl = restUri
|
||||
.resolve("testOccurrences?locator=build:(id:$buildId),count:$countOfTestsOnPage,start:$startPosition" +
|
||||
"&includePersonal=true&fields=testOccurrence(id,name,status,duration,runOrder)")
|
||||
"&includePersonal=true&fields=testOccurrence(id,name,status,duration,runOrder,currentlyMuted)")
|
||||
|
||||
val rawData = Cache.get(fullUrl) { get(fullUrl).toString() }
|
||||
|
||||
|
||||
@@ -314,6 +314,54 @@
|
||||
"status": "SUCCESS",
|
||||
"duration": 11,
|
||||
"runOrder": "45"
|
||||
},
|
||||
{
|
||||
"id": "build:(id:256778038),id:2000000193",
|
||||
"name": "org.jetbrains.intellij.build.io.ProcessTest.threadDump",
|
||||
"status": "UNKNOWN",
|
||||
"duration": 0,
|
||||
"runOrder": "57842",
|
||||
"currentlyMuted": false
|
||||
},
|
||||
{
|
||||
"id": "build:(id:256778038),id:2000000194",
|
||||
"name": "com.intellij.ide.impl.TrustedProjectsHeavyTest.test collecting project roots",
|
||||
"status": "SUCCESS",
|
||||
"duration": 258,
|
||||
"runOrder": "53792",
|
||||
"currentlyMuted": true
|
||||
},
|
||||
{
|
||||
"id": "build:(id:256778038),id:2000000195",
|
||||
"name": "com.intellij.ide.impl.TrustedProjectsHeavyTest: com.intellij.ide.impl.TrustedProjectsHeavyTest.test performance of collecting project roots(int, int, int, int, int): com.intellij.ide.impl.TrustedProjectsHeavyTest.[1] 1, 1, 1, 1000, 100",
|
||||
"status": "SUCCESS",
|
||||
"duration": 149,
|
||||
"runOrder": "53793",
|
||||
"currentlyMuted": true
|
||||
},
|
||||
{
|
||||
"id": "build:(id:256778038),id:2000000197",
|
||||
"name": "com.intellij.ide.impl.TrustedProjectsHeavyTest: com.intellij.ide.impl.TrustedProjectsHeavyTest.test performance of collecting project roots(int, int, int, int, int): com.intellij.ide.impl.TrustedProjectsHeavyTest.[3] 1, 5000, 1, 1000, 100",
|
||||
"status": "SUCCESS",
|
||||
"duration": 30327,
|
||||
"runOrder": "53795",
|
||||
"currentlyMuted": false
|
||||
},
|
||||
{
|
||||
"id": "build:(id:256778038),id:2000000198",
|
||||
"name": "com.intellij.ide.impl.TrustedProjectsHeavyTest: com.intellij.ide.impl.TrustedProjectsHeavyTest.test performance of collecting project roots(int, int, int, int, int): com.intellij.ide.impl.TrustedProjectsHeavyTest.[4] 5000, 1, 1, 1000, 100",
|
||||
"status": "SUCCESS",
|
||||
"duration": 31049,
|
||||
"runOrder": "53796",
|
||||
"currentlyMuted": false
|
||||
},
|
||||
{
|
||||
"id": "build:(id:256778038),id:2000000199",
|
||||
"name": "com.intellij.ide.impl.TrustedProjectsHeavyTest: com.intellij.ide.impl.TrustedProjectsHeavyTest.test performance of collecting project roots(int, int, int, int, int): com.intellij.ide.impl.TrustedProjectsHeavyTest.[5] 5, 100, 10, 1000, 100",
|
||||
"status": "SUCCESS",
|
||||
"duration": 4830,
|
||||
"runOrder": "53797",
|
||||
"currentlyMuted": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,7 +3,10 @@ package com.intellij.testFramework
|
||||
|
||||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||
import com.intellij.nastradamus.NastradamusClient
|
||||
import com.intellij.nastradamus.model.*
|
||||
import com.intellij.nastradamus.model.BuildInfo
|
||||
import com.intellij.nastradamus.model.ChangeEntity
|
||||
import com.intellij.nastradamus.model.SortRequestEntity
|
||||
import com.intellij.nastradamus.model.TestCaseEntity
|
||||
import com.intellij.teamcity.TeamCityClient
|
||||
import com.intellij.tool.Cache
|
||||
import com.intellij.tool.withErrorThreshold
|
||||
@@ -110,25 +113,6 @@ class NastradamusClientTest {
|
||||
changesEntities.forEach { Assert.assertTrue("User name must not be blank", it.userName.isNotBlank()) }
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("Do not use TC. Use mocks / test data")
|
||||
fun collectingTestResultsFromTC() {
|
||||
val tests = tcClient.getTestRunInfo("226830449")
|
||||
|
||||
val testResultEntities = tests.map { json ->
|
||||
TestResultEntity(
|
||||
name = json.findValue("name").asText(),
|
||||
status = TestStatus.fromString(json.findValue("status").asText()),
|
||||
runOrder = json.findValue("runOrder").asInt(),
|
||||
duration = json.findValue("duration")?.asLong() ?: 0,
|
||||
buildType = tcClient.buildTypeId,
|
||||
buildStatusMessage = tcClient.getBuildInfo().findValue("statusText").asText()
|
||||
)
|
||||
}
|
||||
|
||||
println(testResultEntities)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getBuildInfoTriggeredByAggregator() {
|
||||
tcMockServer.enqueue(getOkResponse("teamcity/Build_Info_Triggered_By_Aggregator.json"))
|
||||
@@ -232,5 +216,6 @@ class NastradamusClientTest {
|
||||
|
||||
Assert.assertEquals("Requested path should be equal", "/result/?build_id=100500", request.path)
|
||||
Assert.assertEquals("POST request should be sent", "POST", request.method)
|
||||
Assert.assertTrue("Converted test entities must have 2 muted tests", testResultRequestEntity.testRunResults.count { it.isMuted } == 2)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user