Skip to content
This repository was archived by the owner on Dec 7, 2019. It is now read-only.

Adding support for Android Test Orchestrator#157

Merged
yunikkk merged 2 commits intogojuno:masterfrom
jonas-m-:feature/orchestrator-support
Oct 14, 2018
Merged

Adding support for Android Test Orchestrator#157
yunikkk merged 2 commits intogojuno:masterfrom
jonas-m-:feature/orchestrator-support

Conversation

@jonas-m-
Copy link
Copy Markdown
Contributor

@jonas-m- jonas-m- commented Sep 17, 2018

This fixes #90, closes #131 and closes #135

Tested in production - works perfectly, also the report generation

One point of uncertainty - the requirement to install test orchestrator and test services APKs before running the tests. I'm not convinced that this should be something composer itself should be concerned with, as those APKs just need to be installed, no parsing is done on them otherwise (as opposed to normal app/test APKs)

The installation can either be done manually (as described in the official docs) OR, if used with Gradle - with a custom task, something like this:

android {
    defaultConfig {
        ...

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        testInstrumentationRunnerArguments clearPackageData: 'true'
    }
    testOptions {
        execution 'ANDROID_TEST_ORCHESTRATOR'
    }
}

dependencies {
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestUtil 'com.android.support.test:orchestrator:1.0.2'
}

task installTestUtils() {
    doFirst {
        // Resolve and install all files associated with androidTestUtil configuration, which will be both - test services and the orchestrator APKs
        configurations.androidTestUtil.resolvedConfiguration.files.forEach { filePath ->
            println "Installing ${filePath} ..."
            exec {
                workingDir projectDir
                commandLine 'adb', 'install', '-r', filePath
            }
        }
    }
}

Copy link
Copy Markdown

@pazone pazone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Perhaps it makes sense to improve unit test coverage for new functionality

@CristianGM
Copy link
Copy Markdown
Contributor

@jonas-m- would you add some unit tests?

@jonas-m-
Copy link
Copy Markdown
Contributor Author

jonas-m- commented Oct 8, 2018

@jonas-m- would you add some unit tests?

Sure - will do

@yunikkk
Copy link
Copy Markdown
Contributor

yunikkk commented Oct 14, 2018

@jonas-m- sorry again for the delays, finally can handle the PR.
Regarding your question about orchestrator and test services apks - seems to me that it's enough to point users that they need to setup it correctly. And we can improve that in future, as well.

Weird enough that issue with orchestrator not printing output is resolved but issue https://issuetracker.google.com/issues/64486480 is not closed)

Thanks a lot for contribution!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Orchestrator like" execution mode Continue test run in case of crash Add Test Orchestrator support.

4 participants