简体   繁体   English

当Swagger-Diff返回差异时让Jenkins失败

[英]Getting Jenkins to fail when Swagger-Diff returns differences

So I have a Jenkins job I'm testing right now that is comparing two Swagger contract files like this . 所以我有一个詹金斯的工作我的测试,现在是比较两个扬鞭合同文件这样

I'm using this to run my compare: 我正在使用它来进行比较:

npx swagger-diff <url1> <url2>

What happens when I modify the contract on two of the endpoints I only get a warning and not an error and it wont cause Jenkins to report that the build failed. 当我在两个端点上修改合同时会发生什么,我只会收到警告而不是错误,并且不会导致Jenkins报告构建失败。 Is there anyway I can configure this to ensure that the Jenkins build will fail if there are contract differences? 无论如何,我可以对此进行配置以确保在存在合同差异的情况下Jenkins构建会失败吗?

The ultimate goal if this is to be able to watch an endpoint so that we know when it is failing. 最终目标是能够监视端点,以便我们知道端点何时失败。

因此,我最终使用Jenkins插件Log Parser来解决此问题,以通读日志并查找我们确定为“致命”的特定重大更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM