android / android/android-test

Frequent 'No tests found' when sharding tests

Aperta
#973 5 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug
Lingua principale
Java
Stelle
1.2k
Fork
342
Merge medio
11h 29m
PR unite (30g)
2

Descrizione

Description

When sharding tests I get frequent (and seemingly random) 'No tests found' errors which fail the build.

See this PR: https://github.com/google/accompanist/pull/463 for an example.

Steps to Reproduce

I'm not 100% sure what the repro is. Having a small number of tests in the module seems to be the trigger.

I think this is because the library is relying on hashCode being uniformly random over a small data-set, which isn't the case. If the module only has ~5 tests, and I'm sharding over 3 runs, the chance of at least 1 shard having 0 tests is quite high.

Expected Results

Shards with no tests from a module don't fail the build.

Actual Results
com.android.build.gradle.internal.testing.ConnectedDevice > No tests found.[test(AVD) - 5.1.1] FAILED 
No tests found. This usually means that your test classes are not in the form that your test runner expects (e.g. don't inherit from TestCase or lack @Test annotations).
AndroidX Test and Android OS Versions

1.3.0

Link to a public git repo demonstrating the problem:

https://github.com/google/accompanist/pull/463

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dall’implementazione di TestRequestBuilder.java collegata nell’issue e dal comportamento di sharding dimostrato da accompanist PR 463. Riproduci il caso di un modulo piccolo con più shard e verifica che gli shard che non ricevono test non facciano più fallire la build.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.