我对 Gauge 测试工具有点熟悉,现在正致力于通过 Jenkins 执行它。
首先:我gauge --version
在“执行 Windows 批处理命令”字段中设置。这是输出:
Started by user anonymous
Building in workspace C:\jenkins\workspace\Run_Gauge_Test
[Run_Gauge_Test] $ cmd /c call C:\WINDOWS\TEMP\hudson8329964667758110371.bat
C:\jenkins\workspace\Run_Gauge_Test>gauge --version
Gauge version: 0.6.2
Plugins
-------
No plugins found
Plugins can be installed with `gauge --install {plugin-name}`
C:\jenkins\workspace\Run_Gauge_Test>exit 0
Finished: SUCCESS
将此与我直接在命令行中运行 Gauge 时得到的输出进行比较:
C:\jenkins\workspace\Run_Gauge_Test>gauge --version
Gauge version: 0.6.2
Plugins
-------
html-report (2.1.1)
java (0.5.1)
xml-report (0.1.3)
因此,我将相同的命令放在批处理文件中并运行它只是为了再次获得“未找到插件”消息。作为最后一个选项,我勾选Use custom workspace
并将我的目录设置为我通常从命令行运行仪表测试的文件夹,但仍然是“未找到插件”
然后我尝试将它作为 shell 命令运行。输出:
Started by user anonymous
Building in workspace C:\jenkins\workspace\Run_Gauge_Test
[Run_Gauge_Test] $ sh -xe C:\WINDOWS\TEMP\hudson211231385407124893.sh
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: Cannot run program "sh" (in directory "C:\jenkins\workspace\Run_Gauge_Test"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
(truncated)
at hudson.model.Executor.run(Executor.java:404)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 16 more
Build step 'Execute shell' marked build as failure
Finished: FAILURE
当然,我将实际运行仪表测试(但它不起作用),而不仅仅是获取版本;但我认为解决为什么它没有正确获取插件详细信息会更简单。有什么线索吗?