几步后 SoapUI 挂在 Jenkins 上
SoapUI hanging on Jenkins after couple steps
所以,我已经在 Jenkins slave SLAVE1 机器上安装了 SoapUI,并使用以下命令在我的项目中成功启动了所有测试:
C:\Path_to_bin\testrunner.bat -f"C:\where_to_put_reports\reports" -I -A "C:\SoapUI\projects\project_name.xml"
与此同时,我也同意分享一些匿名数据,这样提示就不会再打扰我了。所有这些都是通过某个 USER1
下的 RDC 完成的
接下来,我创建了一个 Jenkins 作业,限制了 运行 那个特定的奴隶,并在那里添加了 Windows 批处理步骤,与上面完全相同。
我的假设是 运行 没有问题。
我得到的是:
C:\Jenkins\workspace\project_name>C:\Path_to_bin\testrunner.bat -f"C:\where_to_put_reports\reports" -I -A "C:\SoapUI\projects\project_name.xml"
16:25:42,902 INFO [DefaultSoapUICore] Creating new settings at [C:\soapui-settings.xml]
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
16:25:48,952 INFO [PluginManager] 0 plugins loaded in 12 ms
16:25:48,952 INFO [DefaultSoapUICore] All plugins loaded
仅此而已,因为它似乎永远悬而未决。
在批处理命令前添加 start
或 call
没有任何积极效果。
仅供参考: Jenkins 运行正在另一个用户下进行测试,而不是我登录时使用的用户。
那么,问题的根源或修复方法是什么?
如果你这样做 "start" 那么你需要在命令后立即添加双引号,这样它看起来像:
start "" "C:\Path_to_bin\testrunner.bat" -f"C:\where_to_put_reports\reports" -I -A "C:\SoapUI\projects\project_name.xml"
它将运行后台命令。
但是,如果您需要使用 jenkins 伪造测试结果,那么 运行 将它们放在 bg 中并不是最好的主意。另一方面,你总是可以添加一些 whaiter,例如:
timeout /t %timeout_seconds% /nobreak
此外,发布您的 testrunner.bat 可能有助于确定问题。
嗯,其实我应该仔细阅读日志的。
首先,出于某种原因,当使用 Jenkins 启动时,SoapUI 想要创建 soapui-settings.xml
文件:
Creating new settings at [C:\soapui-settings.xml]
甚至没有使用 -t
键覆盖,这很奇怪,但无论如何。 SoapUI CLI args
相反,我按照 HERE 所述使用了 ant。事实上,它与 testrunner.bat
+ 用户参数完全相同。
第一次尝试也没有效果,现在我有同样的日志:
Creating new settings at [C:\Windows\system32\config\systemprofile\soapui-settings.xml]
所以我想出了手动将 soapui-settings.xml
放在 C:\Windows\system32\config\systemprofile\
中的想法,并且成功了:
[DefaultSoapUICore] initialized soapui-settings from [C:\Windows\system32\config\systemprofile\soapui-settings.xml]
实际上,我没有尝试将设置文件放置到 C:\soapui-settings.xml
(就像使用 Win Batch 步骤启动时一样),但我相信它也应该有效。
请注意,这是一种解决方法。
所以,我已经在 Jenkins slave SLAVE1 机器上安装了 SoapUI,并使用以下命令在我的项目中成功启动了所有测试:
C:\Path_to_bin\testrunner.bat -f"C:\where_to_put_reports\reports" -I -A "C:\SoapUI\projects\project_name.xml"
与此同时,我也同意分享一些匿名数据,这样提示就不会再打扰我了。所有这些都是通过某个 USER1
下的 RDC 完成的接下来,我创建了一个 Jenkins 作业,限制了 运行 那个特定的奴隶,并在那里添加了 Windows 批处理步骤,与上面完全相同。
我的假设是 运行 没有问题。
我得到的是:
C:\Jenkins\workspace\project_name>C:\Path_to_bin\testrunner.bat -f"C:\where_to_put_reports\reports" -I -A "C:\SoapUI\projects\project_name.xml"
16:25:42,902 INFO [DefaultSoapUICore] Creating new settings at [C:\soapui-settings.xml]
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
16:25:48,952 INFO [PluginManager] 0 plugins loaded in 12 ms
16:25:48,952 INFO [DefaultSoapUICore] All plugins loaded
仅此而已,因为它似乎永远悬而未决。
在批处理命令前添加 start
或 call
没有任何积极效果。
仅供参考: Jenkins 运行正在另一个用户下进行测试,而不是我登录时使用的用户。
那么,问题的根源或修复方法是什么?
如果你这样做 "start" 那么你需要在命令后立即添加双引号,这样它看起来像:
start "" "C:\Path_to_bin\testrunner.bat" -f"C:\where_to_put_reports\reports" -I -A "C:\SoapUI\projects\project_name.xml"
它将运行后台命令。 但是,如果您需要使用 jenkins 伪造测试结果,那么 运行 将它们放在 bg 中并不是最好的主意。另一方面,你总是可以添加一些 whaiter,例如:
timeout /t %timeout_seconds% /nobreak
此外,发布您的 testrunner.bat 可能有助于确定问题。
嗯,其实我应该仔细阅读日志的。
首先,出于某种原因,当使用 Jenkins 启动时,SoapUI 想要创建 soapui-settings.xml
文件:
Creating new settings at [C:\soapui-settings.xml]
甚至没有使用 -t
键覆盖,这很奇怪,但无论如何。 SoapUI CLI args
相反,我按照 HERE 所述使用了 ant。事实上,它与 testrunner.bat
+ 用户参数完全相同。
第一次尝试也没有效果,现在我有同样的日志:
Creating new settings at [C:\Windows\system32\config\systemprofile\soapui-settings.xml]
所以我想出了手动将 soapui-settings.xml
放在 C:\Windows\system32\config\systemprofile\
中的想法,并且成功了:
[DefaultSoapUICore] initialized soapui-settings from [C:\Windows\system32\config\systemprofile\soapui-settings.xml]
实际上,我没有尝试将设置文件放置到 C:\soapui-settings.xml
(就像使用 Win Batch 步骤启动时一样),但我相信它也应该有效。
请注意,这是一种解决方法。