mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Store artifacts zip with the "<type>-testName-datetime" name
GitOrigin-RevId: cfb8b2db9a084c8961fa52c996aef44a4ca2b567
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d6a53fa1fb
commit
13dff8d4e9
@@ -275,10 +275,10 @@ data class IDERunContext(
|
||||
|
||||
ErrorReporter.reportErrorsAsFailedTests(logsDir / "script-errors", contextName)
|
||||
val (artifactPath, artifactName) = if (successfulRun) contextName to "logs" else "run/$contextName" to "crash"
|
||||
testContext.publishArtifact(logsDir, artifactPath, artifactName)
|
||||
testContext.publishArtifact(logsDir, artifactPath, formatArtifactName(artifactName, testContext.testName))
|
||||
val snapshotFiles = Files.list(testContext.paths.snapshotsDir).use { it.filter { it.isRegularFile() }.toList() }
|
||||
if (snapshotFiles.isNotEmpty()) {
|
||||
testContext.publishArtifact(testContext.paths.snapshotsDir, contextName, "snapshots")
|
||||
testContext.publishArtifact(testContext.paths.snapshotsDir, contextName, formatArtifactName("snapshots", testContext.testName))
|
||||
}
|
||||
if (codeBuilder != null) {
|
||||
host.tearDown(testContext)
|
||||
|
||||
@@ -13,9 +13,16 @@ import java.nio.charset.Charset
|
||||
import java.nio.file.FileStore
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.time.LocalDateTime
|
||||
import java.time.format.DateTimeFormatter
|
||||
import kotlin.io.path.*
|
||||
import kotlin.time.Duration
|
||||
|
||||
fun formatArtifactName(artifactType: String, testName: String): String{
|
||||
val testNameFormatted = testName.replace("/", "-").replace(" ", "")
|
||||
val time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))
|
||||
return "$artifactType-$testNameFormatted-$time"
|
||||
}
|
||||
|
||||
fun getThrowableText(t: Throwable): String {
|
||||
val writer = StringWriter()
|
||||
|
||||
Reference in New Issue
Block a user