https://kotlinlang.org logo
#android
Title
# android
a

Adam Kirk

03/27/2019, 5:20 PM
Ok I feel like I am doing something wrong. I have this “All In App” thing that I can run https://imgur.com/a/E4hnH47 which runs all my unit tests both in test and android Test however if any of them fail (which some do) I run them on there own sometimes they pass and sometimes they dont. if they dont and I change something I have to run them individually then I can run the All In App to see the changes??? Also why do they sometimes work and sometimes not?
k

Kris Wong

03/27/2019, 5:22 PM
I have seen 2 scenarios where tests fail randomly - 1. timing issues, 2. test execution order (due to shine through of state somewhere)
a

Adam Kirk

03/27/2019, 5:24 PM
Here is an example where it fails (when I run all)
And passes individually
But the bigger question is why do I have to run a test individually for the all test to actually run the updated code?
k

Kris Wong

03/27/2019, 5:25 PM
is your all test configuration set to build before running tests?
a

Adam Kirk

03/27/2019, 5:26 PM
how would I check that?
k

Kris Wong

03/27/2019, 5:27 PM
Edit Configuration in the configuration dropdown at the top
a

Adam Kirk

03/27/2019, 5:30 PM
Sorry I dont see where your speaking of?
Screen Shot 2019-03-27 at 11.05.28 AM.png
k

Kris Wong

03/27/2019, 5:31 PM
see Gradle aware make in the before launch section. compare a configuration that works with one that doesn't
a

Adam Kirk

03/27/2019, 5:33 PM
You mean here?
Is that also why my gradle builds every time I run
Hmmm odd cause the Gradle aware Make is there and its the same on all of them (Yet I need to add Build to have it actually build) I dont on others?
c

Corey Johnson

03/27/2019, 5:49 PM
I don't believe you can have a single configuration for running both Unit & Instrumented tests, as they have different build targets
You could set up a gradle task that does both I think
a

Adam Kirk

03/27/2019, 5:55 PM
These Do run both (but it seems that it runs the Android Test as just Tests (not sure why its running both)
As you can see both are being run. Would love to be able to have one that runs both (properly) one that runs just android test and one that just runs unit tests
Ideally
k

Kris Wong

03/27/2019, 7:25 PM
that's the whole premise of Project Nitrogen
but it's not released yet
seems like Google is finally investing some much needed focus on testing
a

Adam Kirk

03/27/2019, 8:05 PM
yeah good 🙂 I remember hearing them announcing it I thought it was out last year.