0

We have a project, that has some instrumented tests that run part of CI Now we want to add some integration tests (of type instrumentation tests), but they should not run as part of pipeline, but on demand through a separate Jenkins job or command I am trying to create a separate module for integration tests that depend on "app" module, but that's throwing a lot of errors like below

errors showing up in android studio while it tries to resolve the app module

I wanted to understand if its even possible?

vjrock
  • 26
  • 2

1 Answers1

0

It is possible. There is probably an easier way than what I am about to suggest but you can implement a rule that conditionally ignores test and change the value of this variable in your CI job.

There are different approaches. 1)Determine which tests to run via a boolean stored in server. So mark your normal ui tests with the condition shouldUITest and the others shouldInstrumentationTest and change their value in server 2)Change variables in app.gradle with buildflavors. (Basically create 2 different variants and run whichever one you want 3)Detect the build is a CI build, and act accordingly in app.gradle

def ciBuild= System.getenv("CI") == "true"
    if (ciBuild) {
        //Do stuff
    }
Prethia
  • 1,183
  • 3
  • 11
  • 26