Speed up Espresso tests using single runner invocation
Run all Espresso test cases in a single test runner invocation to speed up builds on BrowserStack App Automate.
App Automate invokes each Espresso test case separately by default. Enable single runner invocation with the singleRunnerInvocation parameter when faster builds matter more than isolating each test case.
How single runner invocation works
Choose between the default execution mode and single runner invocation based on whether you need test isolation or faster builds:
- Default: The test runner invokes each Espresso test case separately in its own instrumentation instance. This reduces shared state between test cases and improves overall stability. However, each test case spawns a new instrumentation process, which increases the overall execution time of your build.
- Single runner invocation: All test cases run together with a single test runner invocation on each device. This can significantly reduce test execution time. App Automate automatically splits video recordings and debugging logs by test case.
Enable single runner invocation
To disable the default behavior and run all test cases with a single test runner invocation, set the singleRunnerInvocation parameter in the builds REST API request that starts your test execution.
| Parameter | Description | Values |
|---|---|---|
singleRunnerInvocation |
Execute test cases together with a single test runner invocation. | true or false. Default: false |
The following example cURL request starts your Espresso tests with single runner invocation enabled:
Fail fast isn’t supported when single runner invocation is enabled, because there’s no boundary between individual tests at which execution can stop.
Related topics
-
Manage your uploaded app or test suite using the upload app REST API and upload test suite REST API.
-
Use the get app API endpoint and list test suites API endpoint to list your recently uploaded apps and test suites.
-
Delete your uploaded app or test suite using the delete app API endpoint and delete test suite API endpoint.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!