-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests cannot be launched #1481
Comments
Same here.. stuck on "Resolving launch configurations". System : Mac OS |
This comment was marked as resolved.
This comment was marked as resolved.
For anyone encountered this issue, please install vscode-java-test-0.37.2022090109.vsix.zip to see if the problem got fixed and let me know if it's possible. I'll do some verification as well. If everything is fine, I'll plan a hotfix release tomorrow. |
Great, works on my machine. Thank you very much. |
Encountering this bug as well — along with the ~50 students in a Java-based course for whom this bug is their introduction to both Java and VS Code. 😬 I tried installing the vsix fix attached above, and got this when trying to run tests:
Downgrading both the Language Support for Java and Test Runner for Java extensions to the previous release fixes the issue for me:
|
Confirmed error from vsix occurs even after completely uninstalling all Java and Gradle extensions, then doing a clean install. I installed the vsix using:
Is that the correct method? |
Thank you for the fix. I confirmed vscode-java-test-0.37.2022090109.vsix.zip fixed the problem. |
@pcantrell This is because we upgrade the bundled junit jupiter version, which has a breaking change start from 1.7.0. What you need to do is add the dependency |
|
The
Shouldn’t this prevent that problem? Does the VS Code test runner simply ignore the JUnit version specified in the project file? |
Replying to myself: No, I see from experimentation that pinning to an old version of JUnit Jupier in fact causes the problem. Simply updating the Jupiter version number to It seems like a bug that vscode-java-test can’t run tests for projects that specify older JUnit versions. After all, the point of specifying a version is precisely to avoid future breakages like this. Should I file that as a new issue? |
@pcantrell Please check: https://bugs.eclipse.org/bugs/show_bug.cgi?id=569860. To fix this issue, we need to provide delegate to Gradle |
Thanks for the explanation. This comment echoes my thoughts quite closely. This does seem like a fundamental philosophical problem. Fortunately I can simply upgrade JUnit in the projects in question, but at the very least, better diagnostics here would be useful. |
The Gradle Test Delegation (both run and debug) has supported now. To use this feature, you need to install the latest Test Runner for Java and Gradle for Java extension. To delegate the tests to Gradle, you can set the default testing profile in Testing explorer: If you do not want to change the default testing profile, you can trigger an one-time execution via: |
Added by @jdneo:
check #1481 (comment) for the workaround.0.37.1
has been released, the problem should be gone with the latest version.Environment
System : Windows10, WSL2, Debian 11
JDK: OpenJDK 64-Bit Server VM (build 17.0.4+8-Debian-1deb11u1)
Gradle: 7.4.2
VSCode: v1.70.2
redhat.java: v1.10.0
vscjava.vscode-java-test: v0.37.2022083002
vscjava.vscode-java-debug: v0.43.0
Symptom
Test cannot be launched. The notification in the right bottom shows
Run Tests: Resolving launch configuration
foreverHow to reproduce
Application
project withgradle init
.Testing
in the side panel.appHasAGreeting()
and chooseRun Test
.Notes
main
of theApp
class from VSCode works fine.gradle test
works fine.The text was updated successfully, but these errors were encountered: