运行远程硒测试会引发错误:“[testng]未知选项:-sourcedir”
我有一个虚拟机集群(所有 Windows 7),我试图用它来运行 Jenkins 的一些持续集成。这些测试是用 Java 编写的,在我的本地环境(Windows 7)中,我可以远程连接到虚拟机并毫无问题地运行我的测试。
当我安排测试在 Jenkins 中运行时,我使用相同的命令行参数,但在执行过程中我得到:
...
start-server:
doTest:
[testng] Usage: <main class> [options]
[testng] The XML suite files to run
[testng] Unknown option: -sourcedir
[testng] Options:
[testng] -configfailurepolicy Configuration failure policy (skip or
[testng] continue)
[testng] -d Output directory
[testng] -dataproviderthreadcount Number of threads to use when running
[testng] data providers
[testng] -excludegroups Comma-separated list of group names to
[testng] exclude
[testng] -groups Comma-separated list of group names to be
[testng] run
[testng] -junit JUnit mode
[testng] Default: false
[testng] -listener List of .class files or list of class
[testng] names implementing ITestListener or
[testng] ISuiteListener
[testng] -methods Comma separated of test methods
[testng] Default: []
[testng] -methodselectors List of .class files or list of class
[testng] names implementing IMethodSelector
[testng] -objectfactory List of .class files or list of class
[testng] names implementing ITestRunnerFactory
[testng] -parallel Parallel mode (methods, tests or classes)
[testng] -port The port
[testng] -reporter Extended configuration for custom report
[testng] listener
[testng] -suitename Default name of test suite, if not
[testng] specified in suite definition file or
[testng] source code
[testng] -suitethreadpoolsize Size of the thread pool to use to run
[testng] suites
[testng] Default: 1
[testng] -testclass The list of test classes
[testng] -testjar A jar file containing the tests
[testng] -testname Default name of test, if not specified in
[testng] suitedefinition file or source code
[testng] -testnames The list of test names to run
[testng] -testrunfactory, -testRunFactory The factory used to create tests
[testng] -threadcount Number of threads to use when running
[testng] tests in parallel
[testng] -usedefaultlisteners Whether to use the default listeners
[testng] Default: true
[testng] -log, -verbose Level of verbosity
[testng]
stop-server: [selenium-shutdown] 获取: http://localhost:4444/selenium-server/driver /?cmd=关闭 [selenium-shutdown] 至:/var/lib/jenkins/jobs/HomePage/workspace/result.txt [selenium-shutdown] 关闭期间出现 DGF 错误是预料之中的
我的 Jenkins 实例在不同的机器 (ubuntu) 上运行。我刚刚在该盒子上升级到 Ant 1.8.2。这可以是一个测试问题吗?我在几个地方看到过这个问题,但还没有具体的答案,感谢任何帮助,谢谢。
I have a cluster of VM's (all Windows 7) that I am trying to use to run some continuous integration from Jenkins. The tests are written in Java and from my local environment (windows 7) I can remotely connect to a VM and run my tests without any problems.
When I schedule the tests to run in Jenkins, I use the same command line arguments but during execution I get:
...
start-server:
doTest:
[testng] Usage: <main class> [options]
[testng] The XML suite files to run
[testng] Unknown option: -sourcedir
[testng] Options:
[testng] -configfailurepolicy Configuration failure policy (skip or
[testng] continue)
[testng] -d Output directory
[testng] -dataproviderthreadcount Number of threads to use when running
[testng] data providers
[testng] -excludegroups Comma-separated list of group names to
[testng] exclude
[testng] -groups Comma-separated list of group names to be
[testng] run
[testng] -junit JUnit mode
[testng] Default: false
[testng] -listener List of .class files or list of class
[testng] names implementing ITestListener or
[testng] ISuiteListener
[testng] -methods Comma separated of test methods
[testng] Default: []
[testng] -methodselectors List of .class files or list of class
[testng] names implementing IMethodSelector
[testng] -objectfactory List of .class files or list of class
[testng] names implementing ITestRunnerFactory
[testng] -parallel Parallel mode (methods, tests or classes)
[testng] -port The port
[testng] -reporter Extended configuration for custom report
[testng] listener
[testng] -suitename Default name of test suite, if not
[testng] specified in suite definition file or
[testng] source code
[testng] -suitethreadpoolsize Size of the thread pool to use to run
[testng] suites
[testng] Default: 1
[testng] -testclass The list of test classes
[testng] -testjar A jar file containing the tests
[testng] -testname Default name of test, if not specified in
[testng] suitedefinition file or source code
[testng] -testnames The list of test names to run
[testng] -testrunfactory, -testRunFactory The factory used to create tests
[testng] -threadcount Number of threads to use when running
[testng] tests in parallel
[testng] -usedefaultlisteners Whether to use the default listeners
[testng] Default: true
[testng] -log, -verbose Level of verbosity
[testng]
stop-server:
[selenium-shutdown] Getting: http://localhost:4444/selenium-server/driver/?cmd=shutDown
[selenium-shutdown] To: /var/lib/jenkins/jobs/HomePage/workspace/result.txt
[selenium-shutdown] DGF Errors during shutdown are expected
My Jenkins instance runs on a different box (ubuntu). I just upgraded to Ant 1.8.2 on that box. Can this be a testng issue? I've seen this issue a few places but no concrete answers yet, any help is appreciated, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于某种原因,Jenkins 将“-sourcedir”传递给 TestNG,这不是一个公认的选项。
For some reason, Jenkins is passing "-sourcedir" to TestNG, which is not a recognized option.