square / spoon

Distributing instrumentation tests to all your Androids.
https://square.github.io/spoon/
Apache License 2.0
2.7k stars 477 forks source link

Parameterized tests: Could not find class #533

Closed mabae closed 6 years ago

mabae commented 6 years ago

Support for parameterized tests is broken in Spoon 2.0.0-SNAPSHOT.

Scenario: Run an instrumentation test with @RunWith(BurstJUnit4::class) or @RunWith(Parameterized::class)

Expected behaviour: Terminal

[STRL.testStarted] started com.some.BusinessTest[ONLINE]#someTest
[STRL.testEnded] started com.some.BusinessTest[ONLINE]#someTest
[STRL.testStarted] started com.some.BusinessTest[OFFLINE]#someTest
[STRL.testEnded] started com.some.BusinessTest[OFFLINE]#someTest

Actual behaviour: Terminal

[SDR.run] Running com.some.BusinessTest[ONLINE]#someTest on [emulator-5554]
[SDR.run] Running com.some.BusinessTest[OFFLINE]#someTest on [emulator-5554]

Logcat

E/TestLoader: Could not find class: com.some.BusinessTest[ONLINE]

Suggested solution: Strip away the parameter suffix. Example: com.some.BusinessTest[ONLINE]#someTest -> com.some.BusinessTest#someTest Affected class: LogRecordingTestRunListener