【问题标题】:How to report nose tests as skipped in teamcity?如何报告在teamcity中跳过的鼻子测试?
【发布时间】: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 的错误类。

我将如何添加这些更改?看来鼻子测试不再积极维护了......

【问题讨论】:

    标签: teamcity nose


    【解决方案1】:

    此问题无法通过配置解决。 您将不得不破解nose attrib plugin,因为它是负责过滤测试的代码。 TeamCity 无法访问过滤掉的测试,因为它们被 noestest 完全忽略了。

    【讨论】:

    • 我很乐意运行第二遍(如问题中所述),选择被过滤掉的测试并将它们报告为已跳过。这样可以避免它们被过滤掉的问题。
    • 再一次。不幸的是,您无法通过仅配置来实现此目的。您将不得不侵入用于报告 pypi.python.org/pypi/teamcity-messages 的 teamcity-python 桥,或者至少在 github repo 中提交请求
    猜你喜欢
    • 2019-10-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-28
    • 2013-09-25
    相关资源
    最近更新 更多