Skip to content

Commit

Permalink
[qodana] QD-9997 qodana tests: assert on qodana stdout. Also output s…
Browse files Browse the repository at this point in the history
…tdout as a separate artifact

(cherry picked from commit 81aa9f1c631d2b970565211018790481ccbe2ab7)

IJ-CR-149109

GitOrigin-RevId: cdf33d165a2565d926fa77b31da0f19118d20d81
  • Loading branch information
MekhailS authored and intellij-monorepo-bot committed Nov 12, 2024
1 parent f087556 commit 70bb462
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.intellij.ide.starter.models.VMOptions
import com.intellij.ide.starter.models.VMOptions.Companion.ALLOW_SKIPPING_FULL_SCANNING_ON_STARTUP_OPTION
import com.intellij.ide.starter.path.IDEDataPaths
import com.intellij.ide.starter.plugins.PluginConfigurator
import com.intellij.ide.starter.process.exec.ExecOutputRedirect
import com.intellij.ide.starter.profiler.ProfilerType
import com.intellij.ide.starter.project.NoProject
import com.intellij.ide.starter.report.publisher.ReportPublisher
Expand Down Expand Up @@ -382,6 +383,7 @@ open class IDETestContext(
expectedKill: Boolean = false,
expectedExitCode: Int = 0,
collectNativeThreads: Boolean = false,
stdOut: ExecOutputRedirect? = null,
configure: IDERunContext.() -> Unit = {}
): IDEStartResult {
val span = TestTelemetryService.spanBuilder("runIDE").setAttribute("launchName", launchName).startSpan()
Expand All @@ -396,6 +398,7 @@ open class IDETestContext(
expectedKill = expectedKill,
expectedExitCode = expectedExitCode,
collectNativeThreads = collectNativeThreads,
stdOut = stdOut
).also(configure)

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ data class IDERunContext(
val expectedKill: Boolean = false,
val expectedExitCode: Int = 0,
val collectNativeThreads: Boolean = false,
private val stdOut: ExecOutputRedirect? = null
) {
val contextName: String
get() = if (launchName.isNotEmpty()) {
Expand Down Expand Up @@ -332,8 +333,13 @@ data class IDERunContext(

private fun getStderr() = ExecOutputRedirect.ToStdOut("[ide-${contextName}-err]")

private fun getStdout() =
if (verboseOutput) ExecOutputRedirect.ToStdOut("[ide-${contextName}-out]") else ExecOutputRedirect.ToString()
private fun getStdout(): ExecOutputRedirect {
if (stdOut != null) {
return stdOut
}
return if (verboseOutput) ExecOutputRedirect.ToStdOut("[ide-${contextName}-out]") else ExecOutputRedirect.ToString()
}


private fun getErrorMessage(t: Throwable, ciFailureDetails: String?): String? {
val failureCauseFile = logsDir.resolve("failure_cause.txt")
Expand Down Expand Up @@ -497,5 +503,4 @@ data class IDERunContext(
screenRecorder.stop()
}
}

}

0 comments on commit 70bb462

Please sign in to comment.