microsoft / microsoft/vscode-java-test
Test Runner for Java ignores @Order annotations on test classes
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 340
- Fork
- 173
- Merge medio
- 1g 19h
- PR unite (30g)
- 18
Descrizione
Symptom: JUnit 5 test classes which reliably run in the correct order with gradlew test run in the wrong order in the VSCode IDE.
System: Windows 10, VSCode 1.96.3, Gradle 8.12, Spring Boot 3.4.1, Java 21.04, JUnit 5.11.4
Use case: In a Spring Boot client-server Gradle project, the integration tests in the client execute against the running server. The server-side database state built up by earlier integration tests is required by the later integration tests and thus the tests must be executed in a specific order. Accordingly, the test classes and methods are annotated with @Order and the configuration property junit.jupiter.testclass.order.default = org.junit.jupiter.api.ClassOrderer$OrderAnnotation is set. Executed under Gradle the test classes and methods all run in the designated order. However, in the VSCode Testing view contributed by this extension, the test classes get executed in the wrong order and some test methods don't run at all because they use the @EnabledIf annotation to check whether requisite client-side state (reflecting server-side state) has been collected by tests that are supposed to have run already but which in fact haven't yet run.
I've scoured the docs, searched the web and asked several AI chatbots about this but haven't found any solutions that work.
Hypothesis: the test runner is embedded in the extension (v. 0.43.0) and is of too early a version to support test class ordering (~JUnit 5.8, I believe).
Is it possible to override the test runner version?
Related issues: https://github.com/microsoft/vscode-java-test/issues/1740, #1756
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dal percorso di esecuzione della vista VSCode Testing e confrontalo con l’esecuzione dei test Gradle, usando le issue correlate #1740 e #1756 come contesto. Verifica se il comportamento di @Order e @EnabledIf a livello di classe viene preservato; il lavoro è completato quando le classi e i metodi ordinati vengono eseguiti in modo coerente, oppure quando viene documentato l’override della versione del runner supportata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java, typescript, vscode
- Ambito
- devtools, 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