Anyone setup testballoon run roborazzi snapshot te...
# testballoon
e
Anyone setup testballoon run roborazzi snapshot tests in cmp project?
Looks like I have conflicting main thread - test balloon runs things in own threading and raborazzi/robolectric expect main thread or something. I’m getting
Copy code
Caused by: java.lang.UnsupportedOperationException: main looper can only be controlled from main thread
    at org.robolectric.shadows.ShadowPausedLooper.executeOnLooper(ShadowPausedLooper.java:761)
    at org.robolectric.shadows.ShadowPausedLooper.idle(ShadowPausedLooper.java:109)
    at org.robolectric.android.internal.RoboMonitoringInstrumentation.waitForIdleSync(RoboMonitoringInstrumentation.java:85)
    at org.robolectric.android.internal.RoboMonitoringInstrumentation.runOnMainSync(RoboMonitoringInstrumentation.java:196)
    at androidx.compose.ui.test.AndroidSynchronization_androidKt.runOnUiThread(AndroidSynchronization.android.kt:40)
    at androidx.compose.ui.test.RobolectricIdlingStrategy.runUntilIdle(RobolectricIdlingStrategy.android.kt:66)
    at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1.invokeSuspend(ComposeUiTest.android.kt:675)
    at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1.invoke(ComposeUiTest.android.kt)
    at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1.invoke(ComposeUiTest.android.kt)
    at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$1.invokeSuspend(TestBuilders.kt:317)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
    at kotlinx.coroutines.test.TestDispatcher.processEvent$kotlinx_coroutines_test(TestDispatcher.kt:24)
    at kotlinx.coroutines.test.TestCoroutineScheduler.tryRunNextTaskUnless$kotlinx_coroutines_test(TestCoroutineScheduler.kt:98)
    at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$workRunner$1.invokeSuspend(TestBuilders.kt:326)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:256)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:54)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlockingImpl(Builders.kt:30)
    at kotlinx.coroutines.BuildersKt.runBlockingImpl(Unknown Source)
    at kotlinx.coroutines.BuildersKt__Builders_concurrentKt.runBlockingK(Builders.concurrent.kt:172)
    at kotlinx.coroutines.BuildersKt.runBlockingK(Unknown Source)
    at kotlinx.coroutines.BuildersKt__Builders_concurrentKt.runBlockingK$default(Builders.concurrent.kt:157)
    at kotlinx.coroutines.BuildersKt.runBlockingK$default(Unknown Source)
    at kotlinx.coroutines.test.TestBuildersJvmKt.createTestResult(TestBuildersJvm.kt:10)
    at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:309)
    at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:1)
    at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:167)
    at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:1)
    at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.runTest(ComposeUiTest.android.kt:658)
    at androidx.compose.ui.test.junit4.AndroidComposeTestRule$apply$1.evaluate(AndroidComposeTestRule.android.kt:438)
    at de.infix.testBalloon.framework.core.JUnit4RulesContext.execute(TestSuite.android.kt:52)
    at de.infix.testBalloon.framework.core.Test$execute$2$1.invokeSuspend(Test.kt:74)
    at de.infix.testBalloon.framework.core.Test$execute$2$1.invoke(Test.kt)
d
Are you using the robolectric support testballon provides? I'm not sure it'll help here, but it seems like your stack trace shows robolectric...
e
Yes, robolectric required for raborazzi