mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
fix(tooling-api): logs are not properly appended in tooling API tests
This commit is contained in:
@@ -7,9 +7,15 @@ import org.junit.runners.model.Statement
|
||||
/**
|
||||
* A [TestRule] which only runs the tests in a CI environment.
|
||||
*/
|
||||
class CIOnlyTestRule : TestRule {
|
||||
class CIOnlyTestRule(
|
||||
var isEnabled: Boolean = true
|
||||
) : TestRule {
|
||||
|
||||
override fun apply(base: Statement, description: Description?): Statement {
|
||||
if (!isEnabled) {
|
||||
return base
|
||||
}
|
||||
|
||||
return object : Statement() {
|
||||
override fun evaluate() {
|
||||
if (isCi()) {
|
||||
|
||||
+5
-1
@@ -17,7 +17,7 @@
|
||||
|
||||
package com.itsaky.androidide.testing.tooling
|
||||
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import ch.qos.logback.core.CoreConstants
|
||||
import com.itsaky.androidide.testing.tooling.models.ToolingApiTestLauncherParams
|
||||
import com.itsaky.androidide.testing.tooling.models.ToolingApiTestScope
|
||||
import com.itsaky.androidide.tooling.api.IProject
|
||||
@@ -33,6 +33,7 @@ import com.itsaky.androidide.tooling.api.messages.toLogLine
|
||||
import com.itsaky.androidide.tooling.api.util.ToolingApiLauncher
|
||||
import com.itsaky.androidide.tooling.api.util.ToolingProps
|
||||
import com.itsaky.androidide.tooling.events.ProgressEvent
|
||||
import com.itsaky.androidide.tooling.impl.util.LogbackStatusListener
|
||||
import com.itsaky.androidide.utils.FileProvider
|
||||
import com.itsaky.androidide.utils.ILogger
|
||||
import org.slf4j.Logger
|
||||
@@ -182,6 +183,9 @@ object ToolingApiTestLauncher {
|
||||
cmd.add("-D$key=$value")
|
||||
}
|
||||
|
||||
cmd.add(
|
||||
"-D${CoreConstants.STATUS_LISTENER_CLASS_KEY}=${LogbackStatusListener::class.java.name}")
|
||||
|
||||
Collections.addAll(cmd, "-jar", jar)
|
||||
|
||||
println(
|
||||
|
||||
Reference in New Issue
Block a user