From 4e0863436f642e9d6efe45cfcca0adf2ec33e2d7 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 6 Jul 2018 10:15:52 -0400 Subject: [PATCH] Perhaps do a better job of generating junitxml --- .circleci/run-tests.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.circleci/run-tests.sh b/.circleci/run-tests.sh index 8bfef5532..3c629991b 100755 --- a/.circleci/run-tests.sh +++ b/.circleci/run-tests.sh @@ -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