Perhaps do a better job of generating junitxml

This commit is contained in:
Jean-Paul Calderone 2018-07-06 10:15:52 -04:00
parent 8300891ca2
commit 4e0863436f

View File

@ -24,13 +24,19 @@ sudo TAHOE_LAFS_TRIAL_ARGS="--reporter=subunit" \
${TAHOE_LAFS_TOX_ARGS}
# Extract the test process output which should be subunit1-format.
mkdir /tmp/junit
cat /tmp/tox-result.json | /tmp/tests/bin/python -c '
/tmp/tests/bin/python -c '
from json import load
from sys import stdin, stdout, argv
result = load(stdin)
messy_output = result["testenvs"][argv[1]]["test"][-1]["output"]
stdout.write(messy_output.split("\n", 3)[3].strip())
' "${TAHOE_LAFS_TOX_ENVIRONMENT}" |
/tmp/tests/bin/subunit-1to2 |
/tmp/tests/bin/subunit2junitxml > /tmp/junit/results.xml
stdout.write(messy_output.split("\n", 3)[3].strip() + "\n")
' "${TAHOE_LAFS_TOX_ENVIRONMENT}" < /tmp/tox-result.json > /tmp/results.subunit1
# Upgrade subunit version because subunit2junitxml only works on subunit2
/tmp/tests/bin/subunit-1to2 < /tmp/results.subunit1 > /tmp/results.subunit2
# Create a junitxml results area. Put these results in a subdirectory of the
# ultimate location because CircleCI extracts some label information from the
# subdirectory name.
mkdir -p /tmp/junit/unittests
/tmp/tests/bin/subunit2junitxml < /tmp/results.subunit2 > /tmp/junit/unittests/results.xml