Skip to content

Commit 747317c

Browse files
committed
tests
Signed-off-by: Kenneth Reitz <[email protected]>
1 parent 3bc5cf5 commit 747317c

File tree

1 file changed

+29
-53
lines changed

1 file changed

+29
-53
lines changed

run-tests.sh

+29-53
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set -eo pipefail
88
PYPI_VENDOR_DIR="$(pwd)/tests/pypi/"
99
export PYPI_VENDOR_DIR
1010
export PYTHONIOENCODING="utf-8"
11+
export LANG=C.UTF-8
1112

1213
prefix() {
1314
sed "s/^/ $1: /"
@@ -17,62 +18,37 @@ if [[ ! -z "$TEST_SUITE" ]]; then
1718
echo "Using TEST_SUITE=$TEST_SUITE"
1819
fi
1920

20-
# If running in CI environment…
21-
if [[ ! -z "$CI" ]]; then
22-
echo "Running in a CI environment…"
23-
24-
# Use tap output for tests.
25-
TAP_OUTPUT="1"
26-
export TAP_OUTPUT
27-
28-
echo "Installing Pipenv…"
29-
30-
# pip uninstall -y pipenv
31-
export PATH="~/.local/bin:$PATH"
32-
pip install --user -e "$(pwd)" --upgrade
33-
pipenv install --deploy --dev
21+
export PATH="~/.local/bin:$PATH"
22+
echo "Installing Pipenv…"
23+
pip install --user -e "$(pwd)" --upgrade
24+
pipenv install --deploy --dev
3425

3526
# Otherwise, we're on a development machine.
36-
else
37-
# First, try MacOS…
38-
if [[ $(python -c "import sys; print(sys.platform)") == "darwin" ]]; then
39-
40-
echo "Clearing Caches…"
41-
rm -fr ~/Library/Caches/pip
42-
rm -fr ~/Library/Caches/pipenv
43-
44-
# Otherwise, assume Linux…
45-
else
46-
echo "Clearing Caches…"
47-
rm -fr ~/.cache/pip
48-
rm -fr ~/.cache/pipenv
49-
fi
27+
# First, try MacOS…
28+
if [[ $(python -c "import sys; print(sys.platform)") == "darwin" ]]; then
5029

51-
# If the lockfile hasn't changed, skip installs.
52-
53-
echo "Installing Pipenv…"
54-
pip install -e "$(pwd)" --upgrade-strategy=only-if-needed
55-
56-
echo "Installing dependencies…"
57-
PIPENV_PYTHON=2.7 pipenv run pip install -e . --upgrade
58-
PIPENV_PYTHON=3.6 pipenv run pip install -e . --upgrade
59-
PIPENV_PYTHON=2.7 pipenv install --dev
60-
PIPENV_PYTHON=3.6 pipenv install --dev
61-
62-
fi
63-
64-
# Use tap output if in a CI environment, otherwise just run the tests.
65-
if [[ "$TAP_OUTPUT" ]]; then
66-
echo "$ pipenv run time python -m pytest -v -n auto -m \"$TEST_SUITE\" --tap-stream tests/ | tee report-$PYTHON.tap"
67-
pipenv run time python -m pytest -v -n auto -m "$TEST_SUITE" --tap-stream tests/ | tee report.tap
30+
echo "Clearing Caches…"
31+
rm -fr ~/Library/Caches/pip
32+
rm -fr ~/Library/Caches/pipenv
6833

34+
# Otherwise, assume Linux…
6935
else
70-
echo "$ pipenv run time pytest -v -n auto tests -m \"$TEST_SUITE\""
71-
# PIPENV_PYTHON=2.7 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" | prefix 2.7 &
72-
# PIPENV_PYTHON=3.6 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" | prefix 3.6
73-
# Better to run them sequentially.
74-
PIPENV_PYTHON=2.7 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE"
75-
PIPENV_PYTHON=3.6 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE"
76-
# Cleanup junk.
77-
rm -fr .venv
36+
echo "Clearing Caches…"
37+
rm -fr ~/.cache/pip
38+
rm -fr ~/.cache/pipenv
7839
fi
40+
41+
echo "Installing dependencies…"
42+
PIPENV_PYTHON=2.7 pipenv run pip install -e . --upgrade
43+
PIPENV_PYTHON=3.6 pipenv run pip install -e . --upgrade
44+
PIPENV_PYTHON=2.7 pipenv install --dev
45+
PIPENV_PYTHON=3.6 pipenv install --dev
46+
47+
echo "$ pipenv run time pytest -v -n auto tests -m \"$TEST_SUITE\""
48+
# PIPENV_PYTHON=2.7 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" | prefix 2.7 &
49+
# PIPENV_PYTHON=3.6 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" | prefix 3.6
50+
# Better to run them sequentially.
51+
PIPENV_PYTHON=2.7 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE"
52+
PIPENV_PYTHON=3.6 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE"
53+
# Cleanup junk.
54+
rm -fr .venv

0 commit comments

Comments
 (0)