vscode-java-test icon indicating copy to clipboard operation
vscode-java-test copied to clipboard

regression: tests not detected

Open maxandersen opened this issue 2 months ago • 19 comments

I'm not sure when it happened but sometime in the last weeks or possibly month https://github.com/jbangdev/jbang no longer gets its tests detected.

easy to reproduce, git clone https://github.com/jbangdev/jbang , open a test class and see that you can't run the tests from the UI anymore.

I could in past.

Any suggestions on how to pinpoint what causes the tests to not be found would be great :)

maxandersen avatar Oct 22 '25 11:10 maxandersen

Hi @maxandersen, 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.

Suggestions to pinpoint test-detection issues

  • Open the Output panel (View → Output) and select Java Test to see the test-discovery logs. This often shows why tests aren’t picked up. (#1442)
  • In your VS Code settings, set:
    "java.test.logLevel": "verbose"
    
    to get detailed discovery output. (#1442)
  • Run Developer: Toggle Developer Tools (F1) and check the console for any errors from the Java Test extension.
  • Use Java: Clean the Java language server workspace (via Command Palette) and reload the window, to rule out stale caches.
  • Verify that JUnit (or your chosen test framework) and test dependencies are on the classpath (check your Gradle build file).

References with high confidence

  • Update broke the extension (#1442) – describes where to find Java Test logs and how to enable verbose logging.
Other references with low confidence
  • tests not detected (#4010) – reports a similar regression in test discovery after an update, though without a published solution.

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!

github-actions[bot] avatar Oct 22 '25 11:10 github-actions[bot]

no java test found in output but it did make me retry/reinstall Cursor and Code and in Code the tests showsup, but not in Cursor until vscode shows them. Now i killed vscode and cursor seem to find them ... but lets see how long it will keep finding them :)

I verified i have the same plugins and versions installed from the Java extension pack - only diff is the AI extension only available on vscode but i assume that is not related.

maxandersen avatar Oct 22 '25 13:10 maxandersen

Had the same issue today, I found that if I downgrade Language Support for Java by Red Hat from 1.47.0 to 1.46.0 the problem solved, but according to changelog 1.47.0 only released 9 hours ago, and your issue opened last week, so I don't know if it is relevant to yours.

secf4ult avatar Oct 31 '25 01:10 secf4ult

Had the same issue today, I found that if I down grade Language Support for Java by Red Hat from 1.47.0 to 1.46.0 the problem solved, but according to changelog 1.47.0 only released 9 hours ago, and your issue opened last week, so I don't know if it is relevant to yours.

Thanks, this is the route cause, it saved me time.

qianyiwen2019 avatar Oct 31 '25 08:10 qianyiwen2019

@secf4ult Thanks, I wasted so much time because of this bug

Fierygit avatar Oct 31 '25 09:10 Fierygit

Just some additional information, according to https://github.com/redhat-developer/vscode-java/issues/4225 it's already fixed by https://github.com/microsoft/vscode-java-test/pull/1798, but not released for now, you can use the binary the dev provided: https://github.com/redhat-developer/vscode-java/issues/4225#issuecomment-3472447349.

secf4ult avatar Oct 31 '25 13:10 secf4ult

Had the same issue today, I found that if I downgrade Language Support for Java by Red Hat from 1.47.0 to 1.46.0 the problem solved, but according to changelog 1.47.0 only released 9 hours ago, and your issue opened last week, so I don't know if it is relevant to yours.

Thank you

nickchrysaf avatar Oct 31 '25 13:10 nickchrysaf

Same problem, I downgrade to 1.46.0. It's works

Raidez avatar Oct 31 '25 13:10 Raidez

I’ve experienced the same problem here, spent about 4 hours trying to solve, downgrading to 1.46.0 worked for me

rbm4 avatar Oct 31 '25 19:10 rbm4

I’ve experienced the same problem here, spent about 4 hours trying to solve, downgrading to 1.46.0 worked for me

Same with me. 1.46.0 works.

stefandecimelli avatar Oct 31 '25 21:10 stefandecimelli

Had the same issue today, I found that if I downgrade Language Support for Java by Red Hat from 1.47.0 to 1.46.0 the problem solved, but according to changelog 1.47.0 only released 9 hours ago, and your issue opened last week, so I don't know if it is relevant to yours.

Thanks. Downgrading works for me as well.

SuvabrataChowdhury avatar Nov 01 '25 07:11 SuvabrataChowdhury

@secf4ult You are an angel 😭, Thank u so much

AzhadArshad avatar Nov 01 '25 13:11 AzhadArshad

@secf4ult Thanks, I've been pulling my hair out trying to work out what was wrong,

bevans2000 avatar Nov 01 '25 22:11 bevans2000

@secf4ult Thanks, this did save my day.

Apfelholz avatar Nov 02 '25 14:11 Apfelholz

@

Had the same issue today, I found that if I downgrade Language Support for Java by Red Hat from 1.47.0 to 1.46.0 the problem solved, but according to changelog 1.47.0 only released 9 hours ago, and your issue opened last week, so I don't know if it is relevant to yours.

Big thanks! The downgrade solved my issue

DwarkeshDeshmukh avatar Nov 02 '25 19:11 DwarkeshDeshmukh

I confirm this is the solution, lets hope they fix it

Had the same issue today, I found that if I downgrade Language Support for Java by Red Hat from 1.47.0 to 1.46.0 the problem solved, but according to changelog 1.47.0 only released 9 hours ago, and your issue opened last week, so I don't know if it is relevant to yours.

LorenzoSIgnorelliReply avatar Nov 03 '25 14:11 LorenzoSIgnorelliReply

Yes same problem here, from version 1.47.0 the tests are not recognised anymore. This already happend few months ago, hopefully they solve it soon. I switched to 1.46.0 and the tests can be run as usual

lollolg avatar Nov 19 '25 13:11 lollolg

@lollolg ~~latest version 0.43.2 should've fixed it.~~

Edit: looks like it breaks again.

secf4ult avatar Nov 20 '25 00:11 secf4ult

I'm on 1.49.0 and the tests still cannot be seen

lollolg avatar Nov 20 '25 08:11 lollolg