android / android/android-test

androidx.test:orchestrator in test-only module ('com.android.test')

Offen
#767 15 Kommentare 6 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
1.2k
Forks
342
Ø Merge
11 Std. 29 Min.
Gemergte PRs (30 T.)
2

Beschreibung

### Description
We are struggling to use the test orchestrator in our new test only module. We had it working fine when the tests were located in the app module.

One observation is that when working within a test-only module, dependencies are brought in slightly differently

Test only
```
implementation "androidx.test:runner:$androidTestRunnerVersion"
implementation "androidx.test:rules:$androidTestRulesVersion"
implementation "androidx.test.ext:truth:$androidTestTruthExtensionsVersion"
```

Normal app module
```
androidTestimplementation "androidx.test:runner:$androidTestRunnerVersion"
androidTestimplementation "androidx.test:rules:$androidTestRulesVersion"
androidTestimplementation "androidx.test.ext:truth:$androidTestTruthExtensionsVersion"
```

As you can see, the *androidTest* element is omitted. Test orchestrator is brought in using androidTestUtil.. is there an equivalent syntax for test-only modules? Is it possible that a test-only module ignores the androidTestUtil option?

` androidTestUtil 'androidx.test:orchestrator:1.3.0'`

### Steps to Reproduce
Create a test-only module using 'com.android.test' and attempt to use test orchestrator.
### Expected Results
Test orchestrator works as normal
### Actual Results
Test orchestrator isn't leveraged.
### AndroidX Test and Android OS Versions
'androidx.test:orchestrator:1.3.0' - Android 10/11/9
### Link to a public git repo demonstrating the problem:
https://github.com/asavill/test-orchestrator-in-test-only-module-issue

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem verknüpften Repository zur Reproduktion und prüfe, wie das Modul com.android.test androidTestUtil und die Abhängigkeit androidx.test:orchestrator konfiguriert. Überprüfe, ob der Test-Orchestrator für das test-only-Modul installiert und verwendet wird; abgeschlossen ist die Aufgabe, wenn die reproduzierten Tests erwartungsgemäß über den Orchestrator ausgeführt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android, java
Bereich
mobile-dev, testing-qa
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.