【发布时间】:2016-11-03 15:52:18
【问题描述】:
我们有在 teamcity 构建代理上运行的鼻子测试。有些测试很慢,因此不会在每个拉取请求上运行。问题是它们没有被报告为已跳过。他们根本不会出现在 teamcity 报告中。
慢速测试用
标记@attr('nightly')
普通测试是这样运行的:
nosetests path/to/tests --nocapture --nologcapture -v -a '!nightly'
我可以列出夜间测试,而无需像这样运行它们:
nosetests path/to/tests --nocapture --nologcapture -v -a 'nightly' --collect-only
但这会报告它们正在成功运行。
如何让测试被报告给 teamcity 被跳过?
--- 更新---
我一直在四处寻找,发现我要更改的部分在http://nose.readthedocs.io/en/latest/plugins/collect.html?highlight=addSuccess。我想将其更改为 addSkipped,但它已被弃用,因此看起来我应该使用 addError 和来自 http://nose.readthedocs.io/en/latest/plugins/skip.html 的错误类。
我将如何添加这些更改?看来鼻子测试不再积极维护了......
【问题讨论】: