2018-06-15 19:17:32 +00:00
|
|
|
#!/bin/bash -e
|
2018-06-15 18:21:33 +00:00
|
|
|
|
2018-06-15 19:40:50 +00:00
|
|
|
TAHOE_LAFS_TOX_ENVIRONMENT=$1
|
|
|
|
shift
|
|
|
|
|
|
|
|
TAHOE_LAFS_TOX_ARGS=$1
|
2018-06-15 20:02:49 +00:00
|
|
|
shift || :
|
2018-06-15 19:40:50 +00:00
|
|
|
|
2018-07-10 19:17:03 +00:00
|
|
|
# Python packages we need to support the test infrastructure. *Not* packages
|
|
|
|
# Tahoe-LAFS itself (implementation or test suite) need.
|
|
|
|
TEST_DEPS="tox codecov"
|
|
|
|
|
|
|
|
# Python packages we need to generate test reports for CI infrastructure.
|
|
|
|
# *Not* packages Tahoe-LAFS itself (implement or test suite) need.
|
|
|
|
REPORTING_DEPS="python-subunit junitxml subunitreporter"
|
|
|
|
|
2018-07-10 16:59:33 +00:00
|
|
|
# Make sure the ownership of the pip cache directory is correct. The CircleCI
|
2018-07-10 17:32:10 +00:00
|
|
|
# cache management operations seem to mess it up. The cache directory might
|
|
|
|
# not exist if there was no matching cache to restore.
|
2018-07-10 18:10:46 +00:00
|
|
|
[ -e /tmp/nobody/.cache ] && chown --recursive nobody /tmp/nobody/.cache
|
2018-07-10 16:59:33 +00:00
|
|
|
|
2018-06-15 18:21:33 +00:00
|
|
|
# Set up the virtualenv as a non-root user so we can run the test suite as a
|
|
|
|
# non-root user. See below.
|
|
|
|
sudo --set-home -u nobody virtualenv --python python2.7 /tmp/tests
|
2018-07-04 15:19:50 +00:00
|
|
|
|
2018-07-08 22:49:45 +00:00
|
|
|
# Get "certifi" to avoid bug #2913. Basically if a `setup_requires=...` causes
|
|
|
|
# a package to be installed (with setuptools) then it'll fail on certain
|
|
|
|
# platforms (travis's OX-X 10.12, Slackware 14.2) because PyPI's TLS
|
|
|
|
# requirements (TLS >= 1.2) are incompatible with the old TLS clients
|
|
|
|
# available to those systems. Installing it ahead of time (with pip) avoids
|
2018-07-09 19:27:20 +00:00
|
|
|
# this problem. Make sure this step comes before any other attempts to
|
|
|
|
# install things using pip!
|
2018-07-10 19:18:26 +00:00
|
|
|
sudo --set-home -u nobody \
|
|
|
|
PIP_FIND_LINKS="${PIP_FIND_LINKS}" \
|
|
|
|
/tmp/tests/bin/pip install certifi
|
2018-07-08 22:49:45 +00:00
|
|
|
|
2018-07-10 15:16:24 +00:00
|
|
|
# Get a new, awesome version of pip and setuptools. For example, the
|
|
|
|
# distro-packaged virtualenv's pip may not know about wheels.
|
2018-07-10 19:18:26 +00:00
|
|
|
sudo --set-home -u nobody \
|
|
|
|
PIP_FIND_LINKS="${PIP_FIND_LINKS}" \
|
|
|
|
/tmp/tests/bin/pip install --upgrade pip setuptools wheel
|
2018-07-09 19:54:57 +00:00
|
|
|
|
2018-07-09 19:27:20 +00:00
|
|
|
# Populate the wheelhouse, if necessary.
|
2018-07-10 19:18:26 +00:00
|
|
|
sudo --set-home -u nobody \
|
|
|
|
PIP_FIND_LINKS="${PIP_FIND_LINKS}" \
|
|
|
|
/tmp/tests/bin/pip \
|
2018-07-09 19:27:20 +00:00
|
|
|
wheel \
|
|
|
|
--wheel-dir "${WHEELHOUSE_PATH}" \
|
2018-07-10 19:17:03 +00:00
|
|
|
/tmp/project ${TEST_DEPS} ${REPORTING_DEPS}
|
2018-07-05 20:03:37 +00:00
|
|
|
|
2018-07-10 19:18:26 +00:00
|
|
|
sudo --set-home -u nobody \
|
|
|
|
PIP_FIND_LINKS="${PIP_FIND_LINKS}" \
|
|
|
|
/tmp/tests/bin/pip install ${TEST_DEPS} ${REPORTING_DEPS}
|
2018-07-04 15:19:50 +00:00
|
|
|
|
|
|
|
# Get everything else installed in it, too.
|
2018-07-10 19:18:26 +00:00
|
|
|
sudo --set-home -u nobody \
|
|
|
|
PIP_FIND_LINKS="${PIP_FIND_LINKS}" \
|
|
|
|
/tmp/tests/bin/tox \
|
2018-07-06 14:54:31 +00:00
|
|
|
-c /tmp/project/tox.ini \
|
|
|
|
--workdir /tmp/tahoe-lafs.tox \
|
|
|
|
--notest \
|
|
|
|
-e "${TAHOE_LAFS_TOX_ENVIRONMENT}" \
|
|
|
|
${TAHOE_LAFS_TOX_ARGS}
|