microsoft / microsoft/vscode-java-test
Test Runner for Java ignores @Order annotations on test classes
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 340
- フォーク
- 173
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 18
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
VSCode Testing ビューの実行パスから始め、関連する issue #1740 と #1756 をコンテキストとして、Gradle のテスト実行と比較してください。クラスレベルの @Order と @EnabledIf の動作が保持されるかを確認してください。完了とは、順序付けされたクラスとメソッドが一貫して実行されること、またはサポートされている runner バージョンのオーバーライドが文書化されていることを意味します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, typescript, vscode
- 領域
- devtools, testing-qa
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100