Vscode-java-test: JUnit tests not found on symlinked project folder

Created on 26 Feb 2019  路  8Comments  路  Source: microsoft/vscode-java-test

Setup

  • /tmp/project contains a Java maven project with ordinary src/main/java and src/test/java folders. The latter containing JUnit4 test classes
  • a symlink from /tmp/project to /tmp/symlinked exists.
  • open /tmp/symlinked in 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

upstream

All 8 comments

Hi @mweirauch

Do you mean by this?

demo1

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.0 and vscode-java-test 0.16.0 in 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brianngo313 picture brianngo313  路  6Comments

lashchev picture lashchev  路  5Comments

andifalk picture andifalk  路  9Comments

mccreery picture mccreery  路  4Comments

jbelford picture jbelford  路  5Comments