You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the same configuration and issue. The test runner does not see the integration tests unless i add the integration test directory to the test source sets but that behavior is undesirable since then gradle will run the integration tests with the regular unit tests.
I tried setting the test config option in my settings.json file to both of the below and that had no change. "java.test.defaultConfig": "integrationTest" "java.test.defaultConfig": "integration-test"
Here is my build.gradle file. The behavior I expect is that since the task is a type "test" that the java test runner is able to recognize it as a seperate test configuration. Or that i can specify that integration tests is the test configuration i want to run.
The behavior I expect is that since the task is a type "test" that the java test runner is able to recognize it as a seperate test configuration. Or that i can specify that integration tests is the test configuration i want to run.
jbrandli Can you explain more about this? Sorry I do not quite get your idea.
Right now, my integrationTests are not recognized by the java test runner, even though they are junit tests, and they have the gradle category of test.
I can make the java test runner recognize these tests by adding the integration-test directory to the "test" SourceSet configuration, but then i lose the ability to run my integration tests independently of the unit tests.
I would like the java test runner plugin to be able to recognize multiple source sets of tests.
My use case is very similar to this use case except that I am using maven and my tests are in src/main/java. This is because these tests are e2e tests using junit5 that we want to run any time our infrastructure changes. So we build them into a container and run that container as part of our CI/CD process. The test code itself rarely changes but the infra is changing constantly. It doesn't make conceptual sense to use the build process of different project to run tests across the entire application suite.
Gradle now has support for "JVM Test Suites" as a way to cleanly setup unit and integration tests separately. It would be great to see support for running or determining tests from different test suites.
Hi Brian NQC (@briannqc), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
Define a custom source set and test task in your Gradle build so VS Code’s Test Runner can discover and run integration tests. For example in build.gradle:
If you use Eclipse/Buildship under the hood (which VS Code’s Java extensions do), add the integrationTest configuration to the classpath container so the language server picks it up:
After updating build.gradle, run the “Java: Clean Java Language Server Workspace” command in VS Code and reload the window.
Other references with low confidence
Support additional Gradle configurations
• Title: Support additional Gradle configurations
Description: projects with integrationTest source set aren’t recognized by IntelliSense or the language server by default.
URL: redhat-developer/vscode-java#1809
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!
Activity
jdneo commentedon Dec 2, 2018
quoccuongngo
Does the folder
test-integrationmarked astestfolder in the gradle configuration?jbrandli commentedon Mar 19, 2019
I have the same configuration and issue. The test runner does not see the integration tests unless i add the integration test directory to the test source sets but that behavior is undesirable since then gradle will run the integration tests with the regular unit tests.
I tried setting the test config option in my settings.json file to both of the below and that had no change.
"java.test.defaultConfig": "integrationTest" "java.test.defaultConfig": "integration-test"Here is my build.gradle file. The behavior I expect is that since the task is a type "test" that the java test runner is able to recognize it as a seperate test configuration. Or that i can specify that integration tests is the test configuration i want to run.
jdneo commentedon Mar 20, 2019
jbrandli Can you explain more about this? Sorry I do not quite get your idea.
jbrandli commentedon Mar 20, 2019
Right now, my integrationTests are not recognized by the java test runner, even though they are junit tests, and they have the gradle category of test.
I can make the java test runner recognize these tests by adding the integration-test directory to the "test" SourceSet configuration, but then i lose the ability to run my integration tests independently of the unit tests.
I would like the java test runner plugin to be able to recognize multiple source sets of tests.
jbrandli commentedon Mar 20, 2019
I think the easiest option would be a setting for the extension that allows me to add another name for the test runner to look for.
jdneo commentedon May 16, 2019
Thank you jbrandli for your feedback. I'll take a look.
gsiawGH commentedon Nov 16, 2021
has there been any development for this feature?
jdneo commentedon Aug 1, 2022
Another related issue: redhat-developer/vscode-java#2499
Seems that infer the test source paths according to the
.classpathis not good enough.lucastheisen commentedon Nov 25, 2022
My use case is very similar to this use case except that I am using maven and my tests are in
src/main/java. This is because these tests are e2e tests using junit5 that we want to run any time our infrastructure changes. So we build them into a container and run that container as part of our CI/CD process. The test code itself rarely changes but the infra is changing constantly. It doesn't make conceptual sense to use the build process of different project to run tests across the entire application suite.ikstewa commentedon Dec 22, 2022
Gradle now has support for "JVM Test Suites" as a way to cleanly setup unit and integration tests separately. It would be great to see support for running or determining tests from different test suites.
https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html
tehsven commentedon Jun 28, 2023
I also just ran into this issue today with the same setup as the ticket description. Are there any workarounds, or planned solutions to this issue?
Med-H commentedon Oct 5, 2023
any news ?
parthasaradhie commentedon Oct 11, 2023
any update? im facing the similar issue
yunusemreayhan commentedon Apr 9, 2025
I still have same issue
BrunoSouzaPicinini commentedon Oct 10, 2025
Try this
On your .vscode/settings.json
In my case the integration tests is in a module named integrationTest
github-actions commentedon Nov 12, 2025
Hi Brian NQC (@briannqc), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
Define a custom source set and test task in your Gradle build so VS Code’s Test Runner can discover and run integration tests. For example in
build.gradle:sourceSets { integrationTest { java.srcDir 'src/test-integration/java' resources.srcDir 'src/test-integration/resources' } } configurations { integrationTestImplementation.extendsFrom testImplementation integrationTestRuntimeOnly.extendsFrom testRuntimeOnly } task integrationTest(type: Test) { description = 'Runs integration tests.' testClassesDirs = sourceSets.integrationTest.output.classesDirs classpath = sourceSets.integrationTest.runtimeClasspath shouldRunAfter test } check.dependsOn integrationTestIf you use Eclipse/Buildship under the hood (which VS Code’s Java extensions do), add the integrationTest configuration to the classpath container so the language server picks it up:
eclipse { classpath { plusConfigurations += configurations.integrationTestImplementation } }See Support additional Gradle configurations redhat-developer/vscode-java#1809 (comment)
After updating
build.gradle, run the “Java: Clean Java Language Server Workspace” command in VS Code and reload the window.Other references with low confidence
Support additional Gradle configurations
• Title: Support additional Gradle configurations
Description: projects with
integrationTestsource set aren’t recognized by IntelliSense or the language server by default.URL: redhat-developer/vscode-java#1809
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!