dotnet / dotnet/dotnet-docker

Skipped unit tests should not show as "passed"

Aperta
#6,167 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
area-infrastructure up-for-grabs
Lingua principale
Dockerfile
Stelle
4.9k
Fork
2k
Merge medio
1g 14h
PR unite (30g)
26

Descrizione

We have lots of instances of skipping tests in this manner:

https://github.com/dotnet/dotnet-docker/blob/ccbb4f2e87307ef063c576f638ee2416d7a5d57e/tests/Microsoft.DotNet.Docker.Tests/RuntimeDepsImageTests.cs#L33-L38

However, returning early from a test will count as a "passed" test in Xunit, even if we didn't assert anything. This can lead to a false sense of confidence in test outcomes, especially for tests which are intended to be skipped temporarily.

We should find a way to make these tests show as "skipped" instead, like we do with Theories that have no data due to test filtering.

Xunit V3 (which is in preview) supports dynamic skipping of tests natively, but not Xunit V2. There's opportunity to use a library like [Xunit.SkippableFact](https://www.nuget.org/packages/Xunit.SkippableFact), which is used by several other Microsoft projects: [Xunit.SkippableFact > used by ...](https://www.nuget.org/packages/Xunit.SkippableFact#usedby-body-tab).

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con la logica di skip in tests/Microsoft.DotNet.Docker.Tests/RuntimeDepsImageTests.cs e confronta il suo comportamento con le Xunit theories che non hanno dati dopo il filtraggio. Esamina le limitazioni di Xunit V2 e l’opzione Xunit.SkippableFact; il lavoro è completato quando i test temporaneamente saltati vengono riportati come saltati invece che superati nell’intera suite di test interessata.

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

Valutazione

Stack tecnologico
csharp
Ambito
testing
Tipo di issue
Funzionalità
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.