-
Notifications
You must be signed in to change notification settings - Fork 138
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
Cannot run tests when the path has space #1197
Comments
@Empressia thank you for reporting the issue. Would you mind to update it to English? |
I tried to translate. Environment
ProblemTry to run a test that contains "module-info.java"(JPMS file), TestEngine not found.
Remove "module-info.java" and Run Test, the test will run successfully. The test is successful with gralde. ReferenceI created a sample project. |
Thank you @Empressia, will take a look |
@Empressia Please correct me if I'm wrong. The sample project looks very similar with that in #1101. So I guess once the user can set |
"modulePaths"を設定できると、それは解決できるかもれません。 ただそれは、"module-info.java"の違いから考えられる、テストへの入力の違いだからです。 よって、可能性があるとは思いますが、それ以上のことはわかりません。 If I can set "modulePaths", it may be solved. That's because I think the input to the test is different depending on the "module-info.java". So I think there's a possibility of a fix with "modulePaths", but I don't know more than that. |
否定する要素としては、このプロジェクトでは、外部のモジュールを使用していないため、 From a negable point of view, this project doesn't use external modules, so i don't seem to have to explicitly specify module path. |
#1101 は対応いただきました。ありがとうございます。そちらは解決しました。 確認をお願いできますか? なお、確認したバージョンは以下の通りです。 #1101 was supported. thank you. That's solved. Can you check it out? The confirmed version is as follows. Environment
|
What's the version of The sample project https://github.com/Empressia/VSCodeJavaTest02 works on my side without any additional settings: |
Looks like a issue related to the file system. Have you tried it in Eclipse? |
ヒントをありがとうございます。 スペースのないディレクトリパスに移動したら、成功しました(~/Visual Studio Code/VSCodeJaaTest02→~/Temporary/VSCodeJaaTest02)。 スペースのあるディレクトリパスでも動くようにしてもらえるものでしょうか? |
Yes I can repro this issue but have no idea why. The debug console says:
But I didn't see any occurrence of the string |
わたしの想像ですが……。 スタックトレースとJUnitのドキュメントから、JUnitではServiceLoaderを使用して設定を読み込んでいると思います。 そのパスの一部が、上記URLにあります。
その設定をクラスパス上で検索している間に、『\\ProjectDirectoryName』形式のネットワークパスを参照してしまっている……ということでしょう。 あとは、テストの起動時に、どのようなパスが渡っているのかが問題だと思うのですが、 |
Thank you for the information. I added a breakpoint at
And below is the configuration that test runner will pass to the debugger {
name: "Launch Java Tests - Test02Tests",
type: "java",
request: "launch",
mainClass: "org.eclipse.jdt.internal.junit.runner.RemoteTestRunner",
projectName: "VSCodeJavaTest02 master",
cwd: "C:\\Users\\<user_name>\\Downloads\\VSCodeJavaTest02 master",
classPaths: [
"C:\\Users\\<user_name>\\.gradle\\caches\\modules-2\\files-2.1\\org.junit.platform\\junit-platform-commons\\1.7.0\\84e309fbf21d857aac079a3c1fffd84284e1114d\\junit-platform-commons-1.7.0.jar",
"C:\\Users\\<user_name>\\.gradle\\caches\\modules-2\\files-2.1\\org.junit.jupiter\\junit-jupiter-api\\5.7.0\\b25f3815c4c1860a73041e733a14a0379d00c4d5\\junit-jupiter-api-5.7.0.jar",
"C:\\Users\\<user_name>\\.gradle\\caches\\modules-2\\files-2.1\\org.hamcrest\\hamcrest\\2.2\\1820c0968dba3a11a1b30669bb1f01978a91dedc\\hamcrest-2.2.jar",
"C:\\Users\\<user_name>\\.gradle\\caches\\modules-2\\files-2.1\\org.apiguardian\\apiguardian-api\\1.1.0\\fc9dff4bb36d627bdc553de77e1f17efd790876c\\apiguardian-api-1.1.0.jar",
"C:\\Users\\<user_name>\\.gradle\\caches\\modules-2\\files-2.1\\org.opentest4j\\opentest4j\\1.2.0\\28c11eb91f9b6d8e200631d46e20a7f407f2a046\\opentest4j-1.2.0.jar",
"C:\\Users\\<user_name>\\.gradle\\caches\\modules-2\\files-2.1\\org.junit.platform\\junit-platform-engine\\1.7.0\\eadb73c5074a4ac71061defd00fc176152a4d12c\\junit-platform-engine-1.7.0.jar",
"C:\\Users\\<user_name>\\.gradle\\caches\\modules-2\\files-2.1\\org.junit.jupiter\\junit-jupiter-engine\\5.7.0\\d9044d6b45e2232ddd53fa56c15333e43d1749fd\\junit-jupiter-engine-5.7.0.jar",
"C:\\Users\\<user_name>\\.vscode\\extensions\\redhat.java-1.2.0\\server\\config_win\\org.eclipse.osgi\\78\\0\\.cp",
"C:\\Users\\<user_name>\\.vscode\\extensions\\redhat.java-1.2.0\\server\\config_win\\org.eclipse.osgi\\47\\0\\.cp",
"C:\\Users\\<user_name>\\.vscode\\extensions\\redhat.java-1.2.0\\server\\config_win\\org.eclipse.osgi\\87\\0\\.cp",
],
modulePaths: [
"C:\\Users\\<user_name>\\Downloads\\VSCodeJavaTest02 master\\bin\\main",
],
args: [
"-version",
"3",
"-port",
"51982",
"-testLoaderClass",
"org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader",
"-loaderpluginname",
"org.eclipse.jdt.junit5.runtime",
"-testNameFile",
"C:\\Users\\<user_name>\\AppData\\Local\\Temp\\testNames4035275782057965145.txt",
],
vmArgs: [
"-ea",
"--add-opens",
"jp.empressia.vscode_java_test/jp.empressia.vscode_java_test_01=ALL-UNNAMED",
"--add-modules=ALL-MODULE-PATH",
"--patch-module",
"jp.empressia.vscode_java_test=C:\\Users\\<user_name>\\Downloads\\VSCodeJavaTest02 master\\bin\\test;\\VSCodeJavaTest02 master\\bin\\default",
"--add-reads",
"jp.empressia.vscode_java_test=ALL-UNNAMED",
],
env: undefined,
envFile: undefined,
noDebug: true,
sourcePaths: undefined,
preLaunchTask: undefined,
__progressId: "6e0a88bd-3a2d-458c-988c-12af44db95da",
console: "internalConsole",
} But so far I haven't did into the BTW, if you have any insight of this, feel free to share, thanks! |
情報ありがとうございます。 vmArgs引数の"--patch-module"のあとに、『~;\\VSCodeJavaTest02 master\\bin\\default"』が含まれているのが問題に見えますがどうでしょうか。 |
環境
問題
JPMSの(module-info.javaを含む)テストを実行しようとすると、
TestEngineを探しに行くときにネットワークパスを探しに行ってエラーとなります。
module-info.javaを削除してRun Testを実行すると正常にテストが実施されます。
gradleからは正常にテストが実施されます。
参考
以下に、サンプルのプロジェクトを作成しました。
https://github.com/Empressia/VSCodeJavaTest02
The text was updated successfully, but these errors were encountered: