Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not clear how to run unit tests #78

Closed
tiagomartinho opened this issue Apr 7, 2017 · 1 comment
Closed

Not clear how to run unit tests #78

tiagomartinho opened this issue Apr 7, 2017 · 1 comment

Comments

@tiagomartinho
Copy link

I tried to run the tests from the command line using:

./gradlew test

But the result is the following:

com.kickstarter.viewmodels.RewardViewModelTest > testUsdConversionForNonUSProject FAILED
    java.lang.AssertionError at RewardViewModelTest.java:457

com.kickstarter.viewmodels.RewardViewModelTest > testMinimumTextViewText FAILED
    java.lang.AssertionError at RewardViewModelTest.java:344

com.kickstarter.viewmodels.RewardViewModelTest > testUsdConversionTextRoundsUp FAILED
    java.lang.AssertionError at RewardViewModelTest.java:516

com.kickstarter.viewmodels.ViewPledgeViewModelTest > testShipping_withShippingLocation FAILED
    java.lang.AssertionError at ViewPledgeViewModelTest.java:256

com.kickstarter.viewmodels.ViewPledgeViewModelTest > testRewardMinimumAndDescriptionTextViewText FAILED
    java.lang.AssertionError at ViewPledgeViewModelTest.java:172

com.kickstarter.viewmodels.ViewPledgeViewModelTest > testBackingAmountAndDateTextViewText FAILED
    java.lang.AssertionError at ViewPledgeViewModelTest.java:74

347 tests completed, 6 failed
:app:testExternalMin21ReleaseUnitTest FAILED

If I run from Android Studio the result is:

340 tests done: 268 failing

java.lang.RuntimeException: java.lang.RuntimeException: build/intermediates/bundles/externalMin21/debug/AndroidManifest.xml not found or not a file; it should point to your project's AndroidManifest.xml

Could you advise me on how to run the tests and then I can add that information to the README?

@luoser
Copy link
Contributor

luoser commented Apr 26, 2017

yep, this is actually related to the recent upgrade to Android Studio 2.3.1 which seems to reset the working directory for our tests

to fix this, go to Run > Edit configurations > Defaults > Android JUnit and set the Working directory: to path/to/android-oss-or-whatever-you-named-this-project/app

note that if you have a test / tests open that you've already tried running you may have to restart the IDE for these defaults to trickle down. let us know if this helps

@luoser luoser closed this as completed Jul 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants