configcat / android-sdk

ConfigCat SDK for Android. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
https://configcat.com/docs/sdk-reference/android
MIT License
13 stars 3 forks source link

Cannot run unit tests directly in Android Studio #8

Closed andrewreeman closed 2 years ago

andrewreeman commented 3 years ago

Describe the bug

Cannot run tests in Android Studio following instructions on CONTRIBUTING.md

Android Studio build is:

_Android Studio 4.2 Build #AI-202.7660.26.42.7322048, built on April 29, 2021 Runtime version: 11.0.8+10-b944.6916264 x8664 VM: OpenJDK 64-Bit Server VM by N/A macOS 10.16 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 8 Registry: external.system.auto.import.disabled=true, debugger.watches.in.variables=false Non-Bundled Plugins: com.github.leomillon.uuidgenerator, com.intellij.marketplace, com.thoughtworks.gauge, org.jetbrains.kotlin, org.intellij.plugins.markdown

Gradle sync does not error. Running ./gradlew test from the terminal successfully runs all the tests

To reproduce

This could be specific to Android Studio 4.2 on Mac.

  1. Open the android-sdk project in Android Studio
  2. Open Run menu
  3. Select Run...
  4. Select All in configcat-android-client
  5. Clicking on the run button does nothing. Nothing appears in the event log.

Expected behavior

All unit tests will be run from Android Studio

Screenshots

Attached is the standard configuration created from following the instructions on the contributing doc.

Screenshot 2021-05-14 at 09 27 27

Screenshot 2021-05-14 at 09 27 35

z4kn4fein commented 3 years ago

Thank you for reporting! We'll look into this and update the related guide accordingly.

kp-cat commented 2 years ago

Thank you for reporting this issue! Sorry for the late response. I updated the CONTRIBUTING.md. With the latest Android Studio (2020.3.1 patch 3) you can run unit tests with these steps:

  1. Open the android-sdk project in Android Studio
  2. Open the context menu of android-sdk [configcat-android-client] project
  3. Select Run 'Tests in 'configcat-...'

I hope it helps.

andrewreeman commented 2 years ago

Thanks for that. Yes that works fine now. Managed to run the tests with no issue