SpecRun returning exit code 120 with @ignore tests

女生的网名这么多〃 提交于 2019-12-06 08:58:55

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!