microsoft / vscode-java-test

Run and debug Java test cases in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test
Other
297 stars 132 forks source link

args being ignored #1699

Open dbmckie opened 5 months ago

dbmckie commented 5 months ago

I have set the following configuration in settings.json:

"java.test.config": {
    "coverage": {
        "appendResult": false
    },
    "testKind": "junit",
    "args": ["--exclude-package=test.package.to.ignore"]
}

But it does not appear that the args array is being passed to the test runner. From the logs:

INFO: Trying to launch Java Program with options: main-class: org.eclipse.jdt.internal.junit.runner.RemoteTestRunner args: -version 3 -port 64185 -testLoaderClass org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader -loaderpluginname org.eclipse.jdt.junit5.runtime -testNameFile C:\Users\user\AppData\Local\Temp\testNames3476799342913323661.txt module-path: class-path: vmArgs: -ea -Dfile.encoding=UTF-8 -cp "C:\Users\user\AppData\Local\Temp\cp_a9xn9vku4dypkzk1huwivwhyw.jar"

dbmckie commented 5 months ago

Tested with

"args": [
    "--exclude-tag=test_tag",
    "--exclude-tag", "test_tag"
]

Output: args: -version 3 -port 64962 -testLoaderClass org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader -loaderpluginname org.eclipse.jdt.junit5.runtime -testNameFile C:\Users\user\AppData\Local\Temp\testNames12627821658992615585.txt

to compare with

"filters": {
    "tags": ["!test_tag"]
}

Output: args: -version 3 -port 64633 -testLoaderClass org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader -loaderpluginname org.eclipse.jdt.junit5.runtime -testNameFile C:\Users\user\AppData\Local\Temp\testNames590903279624443577.txt --exclude-tag test_tag