android-testing icon indicating copy to clipboard operation
android-testing copied to clipboard

[Codelab Issue] Testing Codelab 5.1, Step 9 - "Test events were not received"

Open a-champagne opened this issue 3 years ago • 2 comments

Describe the problem Test code provided will not run in step 9

In which lesson and step of the codelab can this issue be found? 5.1 step 9

How to reproduce? Copy + paste example code from step 9 and run test

Versions Arctic Fox 2020.3.1 Patch 4

Additional information Multiple issues with code provided

  • dependency versions not included in build.gradle (hamcrest and others)
  • trying to run code from steps 8 and 9 result in "Test events were not received" error (see log error below)
  • trying to run code from end_codelab_1 branch also results in this output from the log:
FAILURE: Build failed with an exception.
* What went wrong: 
Execution failed for task ':app:testDebugUnitTest'.
> No tests found for given includes: [com.example.android.architecture.blueprints.todoapp.tasks.TasksViewModelTest.addNewTask_setsNewTaskEvent](filter.includeTestsMatching)
 

codelab: advanced-android-kotlin

a-champagne avatar Jan 24 '22 21:01 a-champagne

Describe the problem Test code provided will not run in step 9

In which lesson and step of the codelab can this issue be found? 5.1 step 9

How to reproduce? Copy + paste example code from step 9 and run test

Versions Arctic Fox 2020.3.1 Patch 4

Additional information Multiple issues with code provided

  • dependency versions not included in build.gradle (hamcrest and others)
  • trying to run code from steps 8 and 9 result in "Test events were not received" error (see log error below)
  • trying to run code from end_codelab_1 branch also results in this output from the log:
FAILURE: Build failed with an exception.
* What went wrong: 
Execution failed for task ':app:testDebugUnitTest'.
> No tests found for given includes: [com.example.android.architecture.blueprints.todoapp.tasks.TasksViewModelTest.addNewTask_setsNewTaskEvent](filter.includeTestsMatching)
 

codelab: advanced-android-kotlin

I have the same issues on my m1 macbook, if you meet this issues on m1 device, try to update room version in build.gradle : up to -> roomVersion = '2.4.0-alpha03'

dothanhnha avatar Feb 16 '22 03:02 dothanhnha

In addition to changing the roomVersion to '2.4.0-alpha03', I had to change the project default JDK in Android Studio:

  1. Double-press Shift, type "Gradle JVM", select it
  2. Under Gradle JDK, select "Download JDK"
  3. Choose Azul 15 (aarch64)
  4. Rebuild project

lindboe avatar Jul 16 '23 21:07 lindboe