Files
pipenv/run-tests.sh
Dan Ryan a6fb4a7945 Update tests
Signed-off-by: Dan Ryan <dan@danryan.co>

Fix windows testing

Signed-off-by: Dan Ryan <dan@danryan.co>

Update runner

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix powershell script

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix git ssl issues

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix test name

Signed-off-by: Dan Ryan <dan@danryan.co>

Update test publication

Signed-off-by: Dan Ryan <dan@danryan.co>

Only run py36 py37 and py27 for testing

Signed-off-by: Dan Ryan <dan@danryan.co>

Enable linux builds

Signed-off-by: Dan Ryan <dan@danryan.co>

triple parallel

Signed-off-by: Dan Ryan <dan@danryan.co>

Update linux tests

Signed-off-by: Dan Ryan <dan@danryan.co>

Make sure home directory exists

Signed-off-by: Dan Ryan <dan@danryan.co>

Use pipenv to run tests

Signed-off-by: Dan Ryan <dan@danryan.co>

add vendoring script to linux build scripts

Signed-off-by: Dan Ryan <dan@danryan.co>

fix vendoring test

Signed-off-by: Dan Ryan <dan@danryan.co>

Lets try it this way

Signed-off-by: Dan Ryan <dan@danryan.co>

Syntax issue

Signed-off-by: Dan Ryan <dan@danryan.co>

Prune vsts-ci folder from manifest

Signed-off-by: Dan Ryan <dan@danryan.co>

Separate manifest step from vendoring

Signed-off-by: Dan Ryan <dan@danryan.co>

Update vsts vendoring script

Signed-off-by: Dan Ryan <dan@danryan.co>

Syntax error..

Signed-off-by: Dan Ryan <dan@danryan.co>

fix vendoring

Signed-off-by: Dan Ryan <dan@danryan.co>

gah wrong version spec!

Signed-off-by: Dan Ryan <dan@danryan.co>

fix vsts

Signed-off-by: Dan Ryan <dan@danryan.co>

test updates

Signed-off-by: Dan Ryan <dan@danryan.co>

VSTS Syntax error...

Signed-off-by: Dan Ryan <dan@danryan.co>

and fix windows runner

Signed-off-by: Dan Ryan <dan@danryan.co>

maybe...

Signed-off-by: Dan Ryan <dan@danryan.co>

does this one work?

Signed-off-by: Dan Ryan <dan@danryan.co>

how about now

Signed-off-by: Dan Ryan <dan@danryan.co>

fix manifest

Signed-off-by: Dan Ryan <dan@danryan.co>

hmm now windows fails?

Signed-off-by: Dan Ryan <dan@danryan.co>

hmmmm...

Signed-off-by: Dan Ryan <dan@danryan.co>

Conditonal testing uses its own special phase

Signed-off-by: Dan Ryan <dan@danryan.co>
2018-08-28 20:44:37 -04:00

71 lines
2.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# NOTE: set TEST_SUITE to be markers you want to run.
set -eo pipefail
export PYTHONIOENCODING="utf-8"
export LANG=C.UTF-8
export PIP_PROCESS_DEPENDENCY_LINKS="1"
prefix() {
sed "s/^/ $1: /"
}
if [[ ! -z "$TEST_SUITE" ]]; then
echo "Using TEST_SUITE=$TEST_SUITE"
fi
HOME=$(readlink -f ~/)
if [[ -z "$HOME" ]]; then
if [[ "$USER" == "root" ]]; then
HOME="/root"
fi
fi
if [[ ! -z "$HOME" ]]; then
export PATH="${HOME}/.local/bin:${PATH}"
fi
# pip uninstall -y pipenv
pip install certifi
export GIT_SSL_CAINFO=$(python -m certifi)
echo "Path: $PATH"
echo "Installing Pipenv…"
PIP_USER="1" python -m pip install --upgrade setuptools
PIP_USER="1" python3 -m pip install --upgrade setuptools
python -m pip install -e "$(pwd)" --upgrade && python3 -m pip install -e "$(pwd)" --upgrade
python3 -m pipenv install --deploy --dev --system
# Otherwise, we're on a development machine.
# First, try MacOS…
if [[ $(python -c "import sys; print(sys.platform)") == "darwin" ]]; then
echo "Clearing Caches…"
rm -fr ~/Library/Caches/pip
rm -fr ~/Library/Caches/pipenv
# Otherwise, assume Linux…
else
echo "Clearing Caches…"
rm -fr ~/.cache/pip
rm -fr ~/.cache/pipenv
fi
echo "Installing dependencies…"
PIPENV_PYTHON=2.7 python3 -m pipenv --venv && pipenv --rm && pipenv install --dev
PIPENV_PYTHON=3.7 python3 -m pipenv --venv && pipenv --rm && pipenv install --dev
PIPENV_PYTHON=2.7 python3 -m pipenv run pip install --upgrade -e .
PIPENV_PYTHON=3.7 python3 -m pipenv run pip install --upgrade -e .
echo "$ pipenv run time pytest -v -n auto tests -m \"$TEST_SUITE\""
# PIPENV_PYTHON=2.7 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" | prefix 2.7 &
# PIPENV_PYTHON=3.6 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" | prefix 3.6
# Better to run them sequentially.
PIPENV_PYTHON=2.7 python3 -m pipenv run time pytest
PIPENV_PYTHON=3.7 python3 -m pipenv run time pytest
# test revendoring
pip3 install --upgrade invoke requests parver vistir
python3 -m invoke vendoring.update
# Cleanup junk.
rm -fr .venv