Repository navigation
feat: support additional Java test source paths - #1939
Vinay Kumar Maheshwaram (sudovinay01) wants to merge 6 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
@microsoft-github-policy-service agree |
|
Could a maintainer please help triage this PR or assign a reviewer when available? It has been open since September 26, and I would appreciate guidance on whether any changes are needed before review. Thank you. |
|
Merged current upstream main into this branch in fcb779f and regenerated package-lock.json from the merged manifest, preserving glob as a production dependency. Validation passed: npm ci, npm run compile, npm run lint, npm run vscode:prepublish, npm run build-plugin, and npm test (165 extension tests plus the unmanaged-folder test). GitHub now reports the PR as mergeable. |
Why this is needed
The Java Test Runner currently discovers test files from source roots classified as test roots by the Java project model. In Gradle projects,
src/main/javaremains a main source root, so TestNG classes there can compile but are not discovered for editor test actions or Test Explorer. Reclassifying that directory as a Gradle test source set would change build semantics and is not appropriate for projects that intentionally keep these classes in main sources.IntelliJ IDEA and Eclipse already discover tests in both main and test source folders and provide run/debug actions for them. This change brings that IDE-level discovery capability to VS Code as an opt-in, without changing Gradle source-set classification or task behavior.
What this changes
java.test.additionalTestSourcePathssetting. Its default is an empty array, preserving existing behavior.globlibrary is declared as a production dependency.Configuration example
{ "java.test.additionalTestSourcePaths": ["app/**/src/main/java"] }Reproducer
The manual acceptance project is available at https://github.com/sudovinay01/repro-java-issue.
Validation
npm test: 165 extension tests passed; activation test passed.npm run lintpassed.AppMainSourceTestandAppTestappeared in Test Explorer and both passed (2/2).