Python 未通过测试的竹子可以';t解析junit

Python 未通过测试的竹子可以';t解析junit,python,testing,junit,bamboo,Python,Testing,Junit,Bamboo,我在django项目中使用竹子作为CI服务器,为了一个良好的开端,我制作了一个简单的脚本,以了解竹子如何显示成功和失败的测试。 我像这样使用py.test: py.test test.py --junitxml=junitresults/results.xml 我的test.py文件包含如下内容: def test_that_fails(): assert 1 == 2 所以它应该失败,竹子应该告诉我,名为“test_that_failes”的测试实际上失败了。它显示未找到失败的测试

我在django项目中使用竹子作为CI服务器,为了一个良好的开端,我制作了一个简单的脚本,以了解竹子如何显示成功和失败的测试。 我像这样使用py.test:

py.test test.py --junitxml=junitresults/results.xml
我的test.py文件包含如下内容:

def test_that_fails():
    assert 1 == 2
所以它应该失败,竹子应该告诉我,名为“test_that_failes”的测试实际上失败了。它显示未找到失败的测试,而可能出现编译错误。在竹子的“测试”选项卡上,我可以看到此版本中没有失败的测试

这是py.test生成的jUnit XML文件:

<?xml version="1.0" encoding="utf-8"?>
<testsuite errors="0" failures="1" name="pytest" skips="0" tests="12" time="1.317">
    <testcase classname="test" name="test_that_fails" time="0.000378847122192">
        <failure message="test failure">def test_that_fails():
        # fail pour tester bamboo
&gt;       assert 1 == 2
E       assert 1 == 2

test.py:7: AssertionError</failure>
    </testcase>
    <testcase classname="test" name="test_engage_front" time="0.149123907089"/>
    <testcase classname="test" name="test_engage_front_ffm" time="0.444163799286"/>
    <testcase classname="test" name="test_engage_manage" time="0.15494799614"/>
    <testcase classname="test" name="test_engage_organisateur" time="0.1144759655"/>
    <testcase classname="test" name="test_engage_admin" time="0.122771978378"/>
    <testcase classname="test" name="test_engage_adminffm" time="0.0980911254883"/>
    <testcase classname="test" name="test_engage_motoball" time="0.0341689586639"/>
    <testcase classname="test" name="test_engage_api" time="0.0104990005493"/>
    <testcase classname="test" name="test_jira" time="0.0974311828613"/>
    <testcase classname="test" name="test_monitoring" time="0.00897479057312"/>
    <testcase classname="test" name="test_static" time="0.00422883033752"/>
</testsuite>

def测试_失败()
#失败倾注测试仪
断言1==2
E断言1==2
test.py:7:AssertionError
如果构建成功,竹将向我展示所有测试的细节、持续时间。。。 我已经在竹子文档上搜索了所有可能的资源,在竹子跟踪器上,这里,没有发现任何人有这个问题


如果你有一些想法,请分享!谢谢。

可能与此问题有关,未找到测试结果,但它给出了您看到的错误

我也遇到了类似的问题,通过将junit任务中的“指定自定义结果目录”框修改为更广泛的搜索模式,它开始为我工作


我使用**/test results.xml来分享我的发现。 我忽略的一点是,如果一个任务失败,Bambor会停止任务链。 因此,如果由于testcase中的错误而导致python manage.py测试失败,bambor将停止并不会解析junit结果

解决方案是将junit解析器作为一个任务放在最后的“Final Tasks”部分下


现在它就像一个符咒

所以,我列出了我的任务,我的junit解析器是最后一个,但我遇到了与您相同的问题。我的列表是-Command->Checkout->Command(实际构建,当它失败时,我相信它不会进入JUnit解析器)。这就是你工作时的设置方式吗?谢谢所以,martync是对的。但我并没有把它放在“最终任务”下,而是放在正常任务的末尾