mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-27 06:20:25 +00:00
Make more intermediate state visible as artifacts
This commit is contained in:
parent
d074d52b48
commit
a23fc6b006
@ -93,7 +93,10 @@ jobs:
|
|||||||
# if the working directory is not readable.
|
# if the working directory is not readable.
|
||||||
working_directory: "/tmp"
|
working_directory: "/tmp"
|
||||||
command: |
|
command: |
|
||||||
/tmp/project/.circleci/run-tests.sh "${TAHOE_LAFS_TOX_ENVIRONMENT}" "${TAHOE_LAFS_TOX_ARGS}"
|
/tmp/project/.circleci/run-tests.sh \
|
||||||
|
/tmp/artifacts \
|
||||||
|
"${TAHOE_LAFS_TOX_ENVIRONMENT}" \
|
||||||
|
"${TAHOE_LAFS_TOX_ARGS}"
|
||||||
|
|
||||||
- store_test_results: &STORE_TEST_RESULTS
|
- store_test_results: &STORE_TEST_RESULTS
|
||||||
path: "/tmp/artifacts/junit"
|
path: "/tmp/artifacts/junit"
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
ARTIFACTS=$1
|
||||||
|
shift
|
||||||
|
|
||||||
TAHOE_LAFS_TOX_ENVIRONMENT=$1
|
TAHOE_LAFS_TOX_ENVIRONMENT=$1
|
||||||
shift
|
shift
|
||||||
|
|
||||||
@ -18,11 +21,19 @@ sudo TAHOE_LAFS_TRIAL_ARGS="--reporter=subunit" \
|
|||||||
--user nobody \
|
--user nobody \
|
||||||
/tmp/tests/bin/tox \
|
/tmp/tests/bin/tox \
|
||||||
-c /tmp/project/tox.ini \
|
-c /tmp/project/tox.ini \
|
||||||
--result-json /tmp/tox-result.json \
|
--result-json "${ARTIFACTS}"/tox-result.json \
|
||||||
--workdir /tmp/tahoe-lafs.tox \
|
--workdir /tmp/tahoe-lafs.tox \
|
||||||
-e "${TAHOE_LAFS_TOX_ENVIRONMENT}" \
|
-e "${TAHOE_LAFS_TOX_ENVIRONMENT}" \
|
||||||
${TAHOE_LAFS_TOX_ARGS}
|
${TAHOE_LAFS_TOX_ARGS}
|
||||||
|
|
||||||
|
TOX_JSON="${ARTIFACTS}"/tox-result.json
|
||||||
|
SUBUNIT1="${ARTIFACTS}"/results.subunit1
|
||||||
|
SUBUNIT2="${ARTIFACTS}"/results.subunit2
|
||||||
|
|
||||||
|
# Use an intermediate directory here because CircleCI extracts some label
|
||||||
|
# information from its name.
|
||||||
|
JUNITXML="${ARTIFACTS}"/junit/unittests/results.xml
|
||||||
|
|
||||||
# Extract the test process output which should be subunit1-format.
|
# Extract the test process output which should be subunit1-format.
|
||||||
/tmp/tests/bin/python -c '
|
/tmp/tests/bin/python -c '
|
||||||
from json import load
|
from json import load
|
||||||
@ -31,13 +42,11 @@ result = load(stdin)
|
|||||||
for environ in argv[1].split(","):
|
for environ in argv[1].split(","):
|
||||||
messy_output = result["testenvs"][environ]["test"][-1]["output"]
|
messy_output = result["testenvs"][environ]["test"][-1]["output"]
|
||||||
stdout.write(messy_output.split("\n", 3)[3].strip() + "\n")
|
stdout.write(messy_output.split("\n", 3)[3].strip() + "\n")
|
||||||
' "${TAHOE_LAFS_TOX_ENVIRONMENT}" < /tmp/tox-result.json > /tmp/results.subunit1
|
' "${TAHOE_LAFS_TOX_ENVIRONMENT}" < "${TOX_JSON}" > "${SUBUNIT1}"
|
||||||
|
|
||||||
# Upgrade subunit version because subunit2junitxml only works on subunit2
|
# Upgrade subunit version because subunit2junitxml only works on subunit2
|
||||||
/tmp/tests/bin/subunit-1to2 < /tmp/results.subunit1 > /tmp/results.subunit2
|
/tmp/tests/bin/subunit-1to2 < "${SUBUNIT1}" > "${SUBUNIT2}"
|
||||||
|
|
||||||
# Create a junitxml results area. Put these results in a subdirectory of the
|
# Create a junitxml results area.
|
||||||
# ultimate location because CircleCI extracts some label information from the
|
mkdir -p "$(dirname "${JUNITXML}")"
|
||||||
# subdirectory name.
|
/tmp/tests/bin/subunit2junitxml < "${SUBUNIT2}" > "${JUNITXML}"
|
||||||
mkdir -p /tmp/artifacts/junit/unittests
|
|
||||||
/tmp/tests/bin/subunit2junitxml < /tmp/results.subunit2 > /tmp/artifacts/junit/unittests/results.xml
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user