SpecRun使用@ignore测试返回退出代码120 [英] SpecRun returning exit code 120 with @ignore tests

查看:536
本文介绍了SpecRun使用@ignore测试返回退出代码120的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为连续集成设置的一部分,从命令行运行SpecRun,最近当SpecRun完成时,一个忽略的( @ignore )测试生成了一个退出代码120。 p>

目前,我们在任何退出代码不等于0(通用成功指标!)时中断构建。



退出代码120意味着什么?它只是一个测试被忽略?或者它意味着更多?



返回什么其他值?



我们收集所有退出代码(目前为1个SpecRun任务,因此只收集了一个退出代码),并输出到退出代码。

  58>完成。 
58>结果:所有测试通过(被忽略5)
58>总数:478
58>成功:473
58>忽略:5
58>待处理:0
58>跳过:0
58>失败:0
58>
58>执行时间:00:00:42.4550000
58>
58>退出代码120
58>
58>构建失败。
58>
58>时间已过00:00:44.21
==========重建全部:57个成功,1个失败,0个跳过==========


解决方案

我在论坛中找到错误代码列表: https://groups.google.com/forum/?fromgroups=#!topic / specrun / vPQ7z2kpkbs



按错误代码排序后,您会看到:

  Unknown = 0,
Succeeded = 110,
Ignored = 120,
Pending = 210
NothingToRun = 310,
Skipped = 320 ,
Inconclusive = 410,
CleanupFailed = 420,
随机失败= 430,
失败= 440,
初始化失败= 450,
FrameworkError = 510,
ConfigurationError = 520,



基于此列表,我们在构建中使用以下命令行脚本服务器执行测试:

  SpecRun.exe [...] 

如果errorlevel 200退出/ b%errorlevel%

exit / b 0

命令返回错误代码。
对于较高的错误级别代码(> = 200),我们返回错误代码以中断构建。

使用此限制(200),成功和忽略的情况被视为成功和其他一切打破了建设。如果你还想允许等待测试(210),你可以在IF中检查更高的错误代码。


Running SpecRun from command line as part of a Continuous Integration setup, and recently an ignored (@ignore) test generated an exit code of 120 when SpecRun completed.

Currently, we break the build on any exit code not equal to 0 (universal success indicator!).

What does exit code 120 mean exactly? Is it simply "A test was ignored"? or does it imply more?

What other values are returned?

Sample build output below. We collect all exit codes (currently 1 SpecRun task, so only 1 exit code is collected), and print out to "exit codes"

58>  Done.
58>  Result: all tests passed (5 ignored)
58>    Total: 478
58>    Succeeded: 473
58>    Ignored: 5
58>    Pending: 0
58>    Skipped: 0
58>    Failed: 0
58>  
58>    Execution Time: 00:00:42.4550000
58>
58>  exit codes 120
58>
58>Build FAILED.
58>
58>Time Elapsed 00:00:44.21
========== Rebuild All: 57 succeeded, 1 failed, 0 skipped ==========

解决方案

I found the list of error codes in the forum: https://groups.google.com/forum/?fromgroups=#!topic/specrun/vPQ7z2kpkbs

After ordering the list by the error code you get:

Unknown = 0,
Succeeded = 110,
Ignored = 120,
Pending = 210 
NothingToRun = 310,
Skipped = 320,
Inconclusive = 410,
CleanupFailed = 420,
RandomlyFailed = 430,
Failed = 440,
InitializationFailed = 450,
FrameworkError = 510,
ConfigurationError = 520,

Based on this list we use the following command line script on the build server to execute the tests:

SpecRun.exe [...]

if errorlevel 200 exit /b %errorlevel%

exit /b 0

We use the exit command to return the error code. For the higher error level codes (>= 200) we return the error code to break the build. However, error codes below that limit are treated as success and we return 0.

Using this limit (200) the Succeeded and Ignored cases are treated as successful and everything else breaks the build. If you also want to allow Pending tests (210) you can simply check for higher error code in the IF.

这篇关于SpecRun使用@ignore测试返回退出代码120的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆