android / android/android-test

Running all tests in specific package with isolated=false doesn't working properly

Open
#937 2 comments 0 reactions 1 assignee Claimed by @adazh View on GitHub
Dominant language
Java
Stars
1.2k
Forks
342
Avg merge
11h 29m
Merged PRs (30d)
2

Description

### Description

With isolated=true (default behavior of Orchestrator), '-e package some.package' options seems to work.

But Orchestrator will run all tests in application when give isolated=false options.

### Steps to Reproduce

1. Add 'isolated' options into gradle `testInstrumentationRunnerArguments isolated: 'false'`
2. Run **Tests in 'some.pacakge'** in Android Studio

or

1. Run this shell command
```
adb shell 'CLASSPATH=$(pm path androidx.test.services) app_process / \
androidx.test.services.shellexecutor.ShellMain am instrument -r -w -e \
targetInstrumentation com.example.android.testing.androidtestorchestratorsample.test/androidx.test.runner.AndroidJUnitRunner \
-e isolated false -e clearPackageData true -e package nottest.intended -e debug false \
androidx.test.orchestrator/androidx.test.orchestrator.AndroidTestOrchestrator'
```

### Expected Results

1. Expected to run tests in specific package

![running with isolated=true](https://user-images.githubusercontent.com/3054645/115494934-8df4d800-a2a1-11eb-848a-9e0a907467af.png)

### Actual Results

1. Run all tests in application

![running with isolated=false](https://user-images.githubusercontent.com/3054645/115494948-951be600-a2a1-11eb-8001-93b5a5d67cde.png)

### AndroidX Test and Android OS Versions

* Device: Samsung S20+ (SM-G986N) with Android 10
* Dependencies version: 1.3.0, 1.4.0-alpha05
* Android Studio: 4.1.2

### Link to a public git repo demonstrating the problem:

* https://github.com/android/testing-samples/tree/main/runner/AndroidTestOrchestratorSample with [patch](https://gist.github.com/WindSekirun/828d63f387aec5065f972201b3c2977f)
* Or, copy-paste tests into another package

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.