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

JUnit tests not found on symlinked project folder

Open mweirauch opened this issue 6 years ago • 11 comments

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

mweirauch avatar Feb 26 '19 20:02 mweirauch

Hi @mweirauch

Do you mean by this?

demo1

jdneo avatar May 17 '19 07:05 jdneo

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!

mweirauch avatar May 17 '19 21:05 mweirauch

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.

jdneo avatar May 18 '19 06:05 jdneo

I can now repro it on Fedora 30. Will look deep into it.

jdneo avatar May 21 '19 07:05 jdneo

Update: Create an issue in the VS Code repo: https://github.com/microsoft/vscode/issues/74104

jdneo avatar May 23 '19 08:05 jdneo

Hi @mweirauch,

Is this issue still occur? From the upstream issue, seems that the VS Code team did some changes regarding to the symlink.

jdneo avatar Nov 01 '19 05:11 jdneo

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.

mweirauch avatar Nov 03 '19 17:11 mweirauch

Mark, Just confirmed this issue still exists in code 1.43.2, Java Test Runner 0.22.2, running on WSL or Ubuntu.

HsunGong avatar Mar 25 '20 07:03 HsunGong

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

sarahcpage avatar Sep 24 '21 17:09 sarahcpage

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

azazar avatar Feb 09 '22 07:02 azazar

@sarahcpage @azazar See https://github.com/microsoft/vscode/issues/74104

jdneo avatar Jul 19 '22 03:07 jdneo