我对Gauge测试工具有点熟悉,现在我正在通过Jenkins执行它 .
首先:我在"Execute Windows Batch Command"字段中设置 gauge --version . 这是输出:
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)
所以我将相同的命令放在批处理文件中并运行它只是为了再次获取"no plugins found"消息 . 作为最后一个选项,我勾选 Use custom workspace 并将我的目录设置为一个文件夹,我通常从命令行运行规范测试,但它仍然是"no plugins found"
然后我尝试将其作为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.(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 16 more
Build step 'Execute shell' marked build as failure
Finished: FAILURE
当然,我将实际运行规范测试(并且它不起作用),而不仅仅是获取版本;但我认为解决为什么它没有正确获取插件细节会更简单 . 有线索吗?