Avoid the artifact steps for integration tests

Integration tests produce none and trying to do these things breaks.
This commit is contained in:
Jean-Paul Calderone 2019-01-24 16:04:26 -05:00
parent ab58c7a938
commit 6ee727d67e
2 changed files with 23 additions and 10 deletions

View File

@ -71,6 +71,8 @@ jobs:
TAHOE_LAFS_TOX_ENVIRONMENT: "coverage"
# Additional arguments to pass to tox.
TAHOE_LAFS_TOX_ARGS: ""
# The path in which test artifacts will be placed.
ARTIFACTS_OUTPUT_PATH: "/tmp/artifacts"
# Convince all of our pip invocations to look at the cached wheelhouse
# we maintain.
WHEELHOUSE_PATH: &WHEELHOUSE_PATH "/tmp/wheelhouse"
@ -152,7 +154,7 @@ jobs:
working_directory: "/tmp"
command: |
/tmp/project/.circleci/run-tests.sh \
/tmp/artifacts \
"${ARTIFACTS_OUTPUT_PATH}" \
"${TAHOE_LAFS_TOX_ENVIRONMENT}" \
"${TAHOE_LAFS_TOX_ARGS}"
# trial output gets directed straight to a log. avoid the circleci
@ -212,6 +214,9 @@ jobs:
<<: *UTF_8_ENVIRONMENT
# Select the integration tests tox environments.
TAHOE_LAFS_TOX_ENVIRONMENT: "integration"
# Disable artifact collection because py.test can't produce any.
ARTIFACTS_OUTPUT_PATH: ""
steps:
# DRY, YAML-style. See the debian-9 steps.

View File

@ -9,14 +9,20 @@ shift
TAHOE_LAFS_TOX_ARGS=$1
shift || :
# Make sure we can actually write things to this directory.
sudo --user nobody mkdir -p "${ARTIFACTS}"
if [ -n "${ARTIFACTS}" ]; then
# If given an artifacts path, prepare to have some artifacts created
# there. The integration tests don't produce any artifacts; that is the
# case where we expect not to end up here.
SUBUNIT2="${ARTIFACTS}"/results.subunit2
# Make sure we can actually write things to this directory.
sudo --user nobody mkdir -p "${ARTIFACTS}"
# Use an intermediate directory here because CircleCI extracts some label
# information from its name.
JUNITXML="${ARTIFACTS}"/junit/unittests/results.xml
SUBUNIT2="${ARTIFACTS}"/results.subunit2
# Use an intermediate directory here because CircleCI extracts some label
# information from its name.
JUNITXML="${ARTIFACTS}"/junit/unittests/results.xml
fi
# Run the test suite as a non-root user. This is the expected usage some
# small areas of the test suite assume non-root privileges (such as unreadable
@ -40,6 +46,8 @@ sudo \
-e "${TAHOE_LAFS_TOX_ENVIRONMENT}" \
${TAHOE_LAFS_TOX_ARGS}
# Create a junitxml results area.
mkdir -p "$(dirname "${JUNITXML}")"
/tmp/tests/bin/subunit2junitxml < "${SUBUNIT2}" > "${JUNITXML}"
if [ -n "${ARTIFACTS}" ]; then
# Create a junitxml results area.
mkdir -p "$(dirname "${JUNITXML}")"
/tmp/tests/bin/subunit2junitxml < "${SUBUNIT2}" > "${JUNITXML}"
fi