pytest-testinfra icon indicating copy to clipboard operation
pytest-testinfra copied to clipboard

Repeated "system-out" and "system-err" Elements in JUnitXML

Open ryan-rs opened this issue 7 years ago • 0 comments

Description

If a user enables output of JUnitXML when using testinfra, intermittently the "system-out" and "system-err" elements will get repeated with the same exact information. We're not sure exactly where this error is originating from, but our best guess it is testinfra, but it could potently be pytest or Molecule. If this is the wrong project then just let us know.

Example: (some information was culled for readability)

</testcase>
    <testcase classname="tests.test_write_to_attached_storage" file="tests/test_write_to_attached_storage.py" line="50" name="test_volume_attached[ansible://infra1]" time="257.773535728">
        <properties>
            <property name="test_step" value="false"/>
            <property name="test_id" value="3d77bc35-7a21-11e8-90d1-6a00035510c0"/>
            <property name="jira" value="ASC-257"/>
            <property name="jira" value="ASC-883"/>
            <property name="jira" value="RI-417"/>
            <property name="start_time" value="2018-10-23T13:31:23Z"/>
            <property name="end_time" value="2018-10-23T13:35:41Z"/>
        </properties>
        <skipped message="Server is not available" type="pytest.skip">/tmp/system_test_workingdir.WSYYnuxG/rpc-openstack-system-tests/molecules/molecule-rpc-openstack-post-deploy/molecule/default/tests/test_write_to_attached_storage.py:65: Server is not available</skipped>
        <system-out>
===== Debug: get_expected_value logs =====

cmd = . ~/openrc ; openstack server show &apos;post-deploy-server&apos; -f json

Output:
.
.
.
===== End of get_expected_value logs =====
        </system-out>
        <system-err>INFO:testinfra:RUN Ansible(&apos;include_vars&apos;, &apos;file=./vars/main.yml&apos;, {&apos;check&apos;: True}): {&apos;_ansible_no_log&apos;: False,
 &apos;ansible_facts&apos;: {u&apos;custom_fact_path&apos;: u&apos;/etc/ansible/facts.d&apos;,
                   .
                   .
                   .
        </system-err>
        <system-out>
===== Debug: get_expected_value logs =====

cmd = . ~/openrc ; openstack server show &apos;post-deploy-server&apos; -f json

Output:
.
.
.
===== End of get_expected_value logs =====
        </system-out>
        <system-err>INFO:testinfra:RUN Ansible(&apos;include_vars&apos;, &apos;file=./vars/main.yml&apos;, {&apos;check&apos;: True}): {&apos;_ansible_no_log&apos;: False,
 &apos;ansible_facts&apos;: {u&apos;custom_fact_path&apos;: u&apos;/etc/ansible/facts.d&apos;,
                   .
                   .
                   .
        </system-err>
    </testcase>

See attached files molecule_test_results.zip for more details. Lines 17259-20800 in "molecule_test_results.xml" is where the issue is located.

Configuration

Molecule: 2.18.1 testinfra: 1.14.1 pytest: 3.8.2

Reproduction Steps

Note: this issue is intermittent.

Tests are automated, see these resources for more information:

molecule_test_results.zip

ryan-rs avatar Oct 24 '18 15:10 ryan-rs