vscode-java-test
vscode-java-test copied to clipboard
JUnit tests not found on symlinked project folder
Setup
/tmp/projectcontains a Java maven project with ordinarysrc/main/javaandsrc/test/javafolders. The latter containing JUnit4 test classes- a symlink from
/tmp/projectto/tmp/symlinkedexists. - open
/tmp/symlinkedin vs-code - note: it doesn't matter if the last section of the path is a symlink or any section before (e.g.
/tmp/symlinked-path/project)
Observed
- Test explorer shows no unit tests (root element is called "symlinked")
- opening a test class and running the test manually results in the following message:
Failed to get workspace folder for the test item: file:///tmp/project/src/test/java/...(it shows the traversed path)
Expected
- Test explorer lists unit tests
- opening a test class and running the test works
vs-code: 1.31.1 vscode-java-test: 0.14.1
Hi @mweirauch
Do you mean by this?

Yap that basically describes it. I have tried with a simple Spring Boot starter project as you did and it fails with the same error message.
- I am on vscode
1.34.0and vscode-java-test0.16.0in between. - I tried disabling all extensions, enabling only the relevant vscode-java-test, which triggers re-enabling of the other java required ones.
- I tried with a maven and a gradle project, same non-working result.
- The only difference is that I am on Fedora 29 instead of OSX.
- JDK:
OpenJDK Runtime Environment (build 1.8.0_212-b04)
Honestly, getting a bit clueless now. Thanks for looking!
I see. I'll run it in Fedora 29 in a VM later when I have time. Please also feel free to comment if you find anything.
Thanks.
I can now repro it on Fedora 30. Will look deep into it.
Update: Create an issue in the VS Code repo: https://github.com/microsoft/vscode/issues/74104
Hi @mweirauch,
Is this issue still occur? From the upstream issue, seems that the VS Code team did some changes regarding to the symlink.
Hi. Thanks for the heads-up. I just re-tested and I still get the same "issue".
Had to downgrade to 1.38.1 though, because I got bitten by this.
From referenced issues on the upstream issue I do understand, that symlinks shall not be followed. Not sure in what area vscode-java-test plays a role here. In the meantime of course I refrain from opening projects with symlinks within the path to project itself.
Mark, Just confirmed this issue still exists in code 1.43.2, Java Test Runner 0.22.2, running on WSL or Ubuntu.
me too - please fix!
VS Code: Version: 1.60.2 Commit: 7f6ab5485bbc008386c4386d08766667e155244e Date: 2021-09-22T11:59:27.195Z Electron: 13.1.8 Chrome: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Darwin x64 20.6.0
Java test Runner 0.32.0 Workspace located on remote Centos 7 VM
It's not fixed yet.
VSCode
Version: 1.63.2
Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3
Date: 2021-12-15T09:39:46.686Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.13.0-27-generic snap
Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
@sarahcpage @azazar See https://github.com/microsoft/vscode/issues/74104