Skip to content
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 add command line arguments via java.test.config #1297

Open
cgillum018 opened this issue Sep 8, 2021 · 2 comments
Open

Cannot add command line arguments via java.test.config #1297

cgillum018 opened this issue Sep 8, 2021 · 2 comments

Comments

@cgillum018
Copy link

I'm trying to add listeners when running testNG tests using the Java Test runner.

In my settings.xml I've added:

"java.test.config": {
"name": "RunWithContinue",
"workingDirectory": "${workspaceFolder}",
"args": [
"-listener", "org.test.TestFilter"
]
},

But when I run:

[ERROR] {"name":"error","attributes":{"message":"Failed to run TestNG tests","trace":"java.lang.ClassNotFoundException: -listener
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at com.microsoft.java.test.runner.testng.TestNGLauncher.getClassName(TestNGLauncher.java:53)
at com.microsoft.java.test.runner.testng.TestNGLauncher.parse(TestNGLauncher.java:46)
at com.microsoft.java.test.runner.testng.TestNGLauncher.execute(TestNGLauncher.java:32)
at com.microsoft.java.test.runner.Launcher.main(Launcher.java:57)
"}}

It seems all args are expected to be a Class/Method name, even though it seems to be the only place to pass TestNG command line arguments:

image

Is there a workaround?

@jdneo
Copy link
Member

jdneo commented Sep 8, 2021

Hi @cgillum018, currently the TestNG runner in this extension is a customized one. So the usage might be different from the TestNG command line arguments.

I think we need to migrate to https://github.com/testng-team/testng-remote to solve this.

@piotrpalek
Copy link

I'm running into the same issue, is there some workaround or base config I could copy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants