android / android/android-test

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

Aperta
#767 15 commenti 6 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
1.2k
Fork
342
Merge medio
11h 29m
PR unite (30g)
2

Descrizione

### 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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal repository di riproduzione collegato e verifica come il modulo com.android.test configura androidTestUtil e la dipendenza androidx.test:orchestrator. Verifica se l’orchestratore dei test è installato e utilizzato per il modulo test-only; il lavoro è completo quando i test riprodotti vengono eseguiti tramite l’orchestratore come previsto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
android, java
Ambito
mobile-dev, testing-qa
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.