From 3e754c52ee7add9232aa699a76782860ba10fcab Mon Sep 17 00:00:00 2001 From: Oliver Charlesworth Date: Sat, 7 Apr 2018 22:14:15 +0100 Subject: [PATCH 01/12] Clean up run-tests.sh --- run-tests.sh | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/run-tests.sh b/run-tests.sh index 92dadae5..e1c4feac 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -8,10 +8,6 @@ set -eo pipefail PYPI_VENDOR_DIR="$(pwd)/tests/pypi/" export PYPI_VENDOR_DIR -prefix() { - sed "s/^/ $1: /" -} - if [[ ! -z "$TEST_SUITE" ]]; then echo "Using TEST_SUITE=$TEST_SUITE" fi @@ -26,28 +22,25 @@ if [[ ! -z "$CI" ]]; then echo "Installing Pipenv…" - pip install -e "$(pwd)" --upgrade pipenv install --deploy --system --dev + pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" --tap-stream + # Otherwise, we're on a development machine. else # First, try MacOS… + echo "Clearing Caches…" if [[ $(python -c "import sys; print(sys.platform)") == "darwin" ]]; then - - echo "Clearing Caches…" - rm -fr ~/Library/Caches/pip - rm -fr ~/Library/Caches/pipenv - + CACHE_ROOT=~/Library/Caches # Otherwise, assume Linux… else - echo "Clearing Caches…" - rm -fr ~/.cache/pip - rm -fr ~/.cache/pipenv + CACHE_ROOT=~/.cache fi + rm -fr ${CACHE_ROOT}/pip + rm -fr ${CACHE_ROOT}/pipenv # If the lockfile hasn't changed, skip installs. - echo "Installing Pipenv…" pip install -e "$(pwd)" --upgrade-strategy=only-if-needed @@ -57,20 +50,9 @@ else PIPENV_PYTHON=2.7 pipenv install --dev PIPENV_PYTHON=3.6 pipenv install --dev -fi - -# Use tap output if in a CI environment, otherwise just run the tests. -if [[ "$TAP_OUTPUT" ]]; then - echo "$ pipenv run time pytest -v -n auto tests -m \"$TEST_SUITE\" --tap-stream | tee report-$PYTHON.tap" - pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" --tap-stream | tee report.tap - -else - 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 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" PIPENV_PYTHON=3.6 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" + # Cleanup junk. rm -fr .venv fi From b9cd7c2a5e325ce4e631677cfe6109b84aac62ac Mon Sep 17 00:00:00 2001 From: Oliver Charlesworth Date: Sat, 7 Apr 2018 23:06:12 +0100 Subject: [PATCH 02/12] Remove more stuff from run_tests.sh --- run-tests.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/run-tests.sh b/run-tests.sh index e1c4feac..873f8273 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -14,17 +14,11 @@ fi # If running in CI environment… if [[ ! -z "$CI" ]]; then - echo "Running in a CI environment…" - - # Use tap output for tests. - TAP_OUTPUT="1" - export TAP_OUTPUT - echo "Installing Pipenv…" - pip install -e "$(pwd)" --upgrade pipenv install --deploy --system --dev + echo "Running tests…" pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" --tap-stream # Otherwise, we're on a development machine. @@ -37,8 +31,8 @@ else else CACHE_ROOT=~/.cache fi - rm -fr ${CACHE_ROOT}/pip - rm -fr ${CACHE_ROOT}/pipenv + rm -fr ${CACHE_ROOT}/pip + rm -fr ${CACHE_ROOT}/pipenv # If the lockfile hasn't changed, skip installs. echo "Installing Pipenv…" @@ -50,6 +44,7 @@ else PIPENV_PYTHON=2.7 pipenv install --dev PIPENV_PYTHON=3.6 pipenv install --dev + echo "Running tests…" PIPENV_PYTHON=2.7 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" PIPENV_PYTHON=3.6 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" From ef2fb0aaa47e6975c054dd23dd8e4bf75b0a6fe3 Mon Sep 17 00:00:00 2001 From: Oliver Charlesworth Date: Sat, 7 Apr 2018 23:13:06 +0100 Subject: [PATCH 03/12] Decouple from run-tests.sh --- .travis.yml | 3 ++- run-tests.sh | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 47cb97d4..6095a6eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,8 @@ install: # command to run the dependencies script: - 'if [[ -n "$RUN_INTEGRATION_TESTS" ]]; then rm -fr ~/.cache/pip; fi' - - "pipenv run bash ./run-tests.sh" + - 'export PYPI_VENDOR_DIR="$(pwd)/tests/pypi/"' + - 'pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" --tap-stream' jobs: include: diff --git a/run-tests.sh b/run-tests.sh index 873f8273..be342245 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -5,8 +5,7 @@ set -eo pipefail # Set the PYPI vendor URL for pytest-pypi. -PYPI_VENDOR_DIR="$(pwd)/tests/pypi/" -export PYPI_VENDOR_DIR +export PYPI_VENDOR_DIR="$(pwd)/tests/pypi/" if [[ ! -z "$TEST_SUITE" ]]; then echo "Using TEST_SUITE=$TEST_SUITE" From e3f71ccaed79779cb46d09911fad8f1bb9be3407 Mon Sep 17 00:00:00 2001 From: Oliver Charlesworth Date: Sat, 7 Apr 2018 23:24:44 +0100 Subject: [PATCH 04/12] Don't run cli tests twice --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6095a6eb..f77de368 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ env: - TEST_SUITE='dotvenv or check or unused or requirements' - TEST_SUITE='complex' - TEST_SUITE='markers or run or project or utils' - - TEST_SUITE='not (dotvenv or check or unused or requirements or complex or markers or run or project or utils or install)' + - TEST_SUITE='not (cli or dotvenv or check or unused or requirements or complex or markers or run or project or utils or install)' # command to install dependencies install: From d523726264399ee72c2a3243973cc3801982e99c Mon Sep 17 00:00:00 2001 From: Oliver Charlesworth Date: Sat, 7 Apr 2018 23:38:29 +0100 Subject: [PATCH 05/12] See what happens if we only run with one TEST_SUITE --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f77de368..b2232a76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,7 @@ python: - "3.6" - "2.7" env: - - TEST_SUITE='dotvenv or check or unused or requirements' - - TEST_SUITE='complex' - - TEST_SUITE='markers or run or project or utils' - - TEST_SUITE='not (cli or dotvenv or check or unused or requirements or complex or markers or run or project or utils or install)' + - TEST_SUITE='not (cli or install)' # command to install dependencies install: From 571859fdedbfb47f8c70cdaacf036e0c6f2f979e Mon Sep 17 00:00:00 2001 From: Oliver Charlesworth Date: Sat, 7 Apr 2018 23:57:33 +0100 Subject: [PATCH 06/12] Simplify further --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index b2232a76..7db8cc1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ python: - "3.6" - "2.7" env: - - TEST_SUITE='not (cli or install)' + - TEST_SUITE='not install' # command to install dependencies install: @@ -22,8 +22,6 @@ script: jobs: include: - - stage: integration - env: TEST_SUITE='cli' - stage: takes-forever env: - TEST_SUITE='install' @@ -31,7 +29,6 @@ jobs: - RUN_INTEGRATION_TESTS=1 stages: - - integration - test - name: takes-forever if: branch = master From 5626e71506638761a57ca8d092a1ac6316daafa2 Mon Sep 17 00:00:00 2001 From: Oliver Charlesworth Date: Sun, 8 Apr 2018 00:09:11 +0100 Subject: [PATCH 07/12] Disable cli tests for py2 --- tests/test_pipenv.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index 4d6556b3..17be995e 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -147,11 +147,13 @@ class TestPipenv: """The ultimate testing class.""" @pytest.mark.cli + @py3_only def test_pipenv_where(self, pypi_secure): with PipenvInstance(pypi=pypi_secure) as p: assert normalize_drive(p.path) in p.pipenv('--where').out @pytest.mark.cli + @py3_only def test_pipenv_venv(self): with PipenvInstance() as p: p.pipenv('--python python') @@ -159,6 +161,7 @@ class TestPipenv: assert os.path.isdir(venv_path) @pytest.mark.cli + @py3_only def test_pipenv_py(self): with PipenvInstance() as p: p.pipenv('--python python') @@ -166,6 +169,7 @@ class TestPipenv: assert os.path.basename(python).startswith('python') @pytest.mark.cli + @py3_only def test_pipenv_rm(self): with PipenvInstance() as p: p.pipenv('--python python') @@ -176,6 +180,7 @@ class TestPipenv: assert not os.path.isdir(venv_path) @pytest.mark.cli + @py3_only def test_pipenv_graph(self, pypi): with PipenvInstance(pypi=pypi) as p: p.pipenv('install requests') @@ -183,6 +188,7 @@ class TestPipenv: assert 'requests' in p.pipenv('graph --json').out @pytest.mark.cli + @py3_only def test_pipenv_graph_reverse(self, pypi): with PipenvInstance(pypi=pypi) as p: p.pipenv('install requests==2.18.4') @@ -208,17 +214,20 @@ class TestPipenv: @pytest.mark.cli @needs_internet + @py3_only def test_pipenv_check(self, pypi): with PipenvInstance(pypi=pypi) as p: p.pipenv('install requests==1.0.0') assert 'requests' in p.pipenv('check').out @pytest.mark.cli + @py3_only def test_venv_envs(self): with PipenvInstance() as p: assert p.pipenv('--envs').out @pytest.mark.cli + @py3_only def test_bare_output(self): with PipenvInstance() as p: assert p.pipenv('').out @@ -229,6 +238,7 @@ class TestPipenv: assert p.pipenv('--help').out @pytest.mark.cli + @py3_only def test_man(self): with PipenvInstance() as p: c = p.pipenv('--man') @@ -236,6 +246,7 @@ class TestPipenv: @pytest.mark.cli @pytest.mark.install + @py3_only def test_install_parse_error(self, pypi): with PipenvInstance(pypi=pypi) as p: @@ -1075,6 +1086,7 @@ records = {extras = ["pandas"], version = "==0.5.2"} @pytest.mark.lock @pytest.mark.deploy @pytest.mark.cli + @py3_only def test_deploy_works(self, pypi): with PipenvInstance(pypi=pypi) as p: @@ -1229,6 +1241,7 @@ requests = "==2.14.0" @pytest.mark.cli @pytest.mark.clean + @py3_only def test_clean_on_empty_venv(self, pypi): with PipenvInstance(pypi=pypi) as p: c = p.pipenv('clean') From e963674e6673c542983ab37847f8048d13b7fb18 Mon Sep 17 00:00:00 2001 From: Oliver Charlesworth Date: Sun, 8 Apr 2018 00:17:49 +0100 Subject: [PATCH 08/12] Remove CI stuff from run-tests.sh --- run-tests.sh | 62 +++++++++++++++++++++------------------------------- 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/run-tests.sh b/run-tests.sh index be342245..c54146c4 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -11,42 +11,30 @@ if [[ ! -z "$TEST_SUITE" ]]; then echo "Using TEST_SUITE=$TEST_SUITE" fi -# If running in CI environment… -if [[ ! -z "$CI" ]]; then - echo "Installing Pipenv…" - pip install -e "$(pwd)" --upgrade - pipenv install --deploy --system --dev - - echo "Running tests…" - pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" --tap-stream - -# Otherwise, we're on a development machine. +# First, try MacOS… +echo "Clearing Caches…" +if [[ $(python -c "import sys; print(sys.platform)") == "darwin" ]]; then + CACHE_ROOT=~/Library/Caches +# Otherwise, assume Linux… else - # First, try MacOS… - echo "Clearing Caches…" - if [[ $(python -c "import sys; print(sys.platform)") == "darwin" ]]; then - CACHE_ROOT=~/Library/Caches - # Otherwise, assume Linux… - else - CACHE_ROOT=~/.cache - fi - rm -fr ${CACHE_ROOT}/pip - rm -fr ${CACHE_ROOT}/pipenv - - # If the lockfile hasn't changed, skip installs. - echo "Installing Pipenv…" - pip install -e "$(pwd)" --upgrade-strategy=only-if-needed - - echo "Installing dependencies…" - PIPENV_PYTHON=2.7 pipenv run pip install -e . --upgrade - PIPENV_PYTHON=3.6 pipenv run pip install -e . --upgrade - PIPENV_PYTHON=2.7 pipenv install --dev - PIPENV_PYTHON=3.6 pipenv install --dev - - echo "Running tests…" - PIPENV_PYTHON=2.7 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" - PIPENV_PYTHON=3.6 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" - - # Cleanup junk. - rm -fr .venv + CACHE_ROOT=~/.cache fi +rm -fr ${CACHE_ROOT}/pip +rm -fr ${CACHE_ROOT}/pipenv + +# If the lockfile hasn't changed, skip installs. +echo "Installing Pipenv…" +pip install -e "$(pwd)" --upgrade-strategy=only-if-needed + +echo "Installing dependencies…" +PIPENV_PYTHON=2.7 pipenv run pip install -e . --upgrade +PIPENV_PYTHON=3.6 pipenv run pip install -e . --upgrade +PIPENV_PYTHON=2.7 pipenv install --dev +PIPENV_PYTHON=3.6 pipenv install --dev + +echo "Running tests…" +PIPENV_PYTHON=2.7 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" +PIPENV_PYTHON=3.6 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" + +# Cleanup junk. +rm -fr .venv From 57a0058e9a17a43163b9f3888b568af316f5be40 Mon Sep 17 00:00:00 2001 From: Oliver Charlesworth Date: Sun, 8 Apr 2018 00:26:38 +0100 Subject: [PATCH 09/12] Fix whitespace --- run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-tests.sh b/run-tests.sh index c54146c4..15928880 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -8,7 +8,7 @@ set -eo pipefail export PYPI_VENDOR_DIR="$(pwd)/tests/pypi/" if [[ ! -z "$TEST_SUITE" ]]; then - echo "Using TEST_SUITE=$TEST_SUITE" + echo "Using TEST_SUITE=$TEST_SUITE" fi # First, try MacOS… From ed416e537a9589f57c5db4c1ad2df7697ba70adf Mon Sep 17 00:00:00 2001 From: Oliver Charlesworth Date: Sun, 8 Apr 2018 00:31:14 +0100 Subject: [PATCH 10/12] Simplify appveyor.yml --- appveyor.yml | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7d20bb95..96c4478e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,23 +21,7 @@ environment: - PYTHON: 'C:\Python27-x64' PYTHON_VERSION: '2.7.x' - TEST_SUITE: 'cli' - - - PYTHON: 'C:\Python27-x64' - PYTHON_VERSION: '2.7.x' - TEST_SUITE: 'dotvenv or check or unused or requirements' - - - PYTHON: 'C:\Python27-x64' - PYTHON_VERSION: '2.7.x' - TEST_SUITE: 'complex' - - - PYTHON: 'C:\Python27-x64' - PYTHON_VERSION: '2.7.x' - TEST_SUITE: 'markers or run or project or utils' - - - PYTHON: 'C:\Python27-x64' - PYTHON_VERSION: '2.7.x' - TEST_SUITE: 'not (cli or dotvenv or check or unused or requirements or complex or markers or run or project or utils)' + TEST_SUITE: 'not install' - PYTHON: 'C:\Python27-x64' PYTHON_VERSION: '2.7.x' @@ -47,23 +31,7 @@ environment: - PYTHON: 'C:\Python36-x64' PYTHON_VERSION: '3.6.x' - TEST_SUITE: 'cli' - - - PYTHON: 'C:\Python36-x64' - PYTHON_VERSION: '3.6.x' - TEST_SUITE: 'dotvenv or check or unused or requirements' - - - PYTHON: 'C:\Python36-x64' - PYTHON_VERSION: '3.6.x' - TEST_SUITE: 'complex' - - - PYTHON: 'C:\Python36-x64' - PYTHON_VERSION: '3.6.x' - TEST_SUITE: 'markers or run or project or utils' - - - PYTHON: 'C:\Python36-x64' - PYTHON_VERSION: '3.6.x' - TEST_SUITE: 'not (cli or dotvenv or check or unused or requirements or complex or markers or run or project or utils)' + TEST_SUITE: 'not install' - PYTHON: 'C:\Python36-x64' PYTHON_VERSION: '3.6.x' From 6f6539b1012a396edb146d377a3c6a7b6b4bae77 Mon Sep 17 00:00:00 2001 From: Oliver Charlesworth Date: Sun, 8 Apr 2018 17:27:58 +0100 Subject: [PATCH 11/12] Fix things --- .travis.yml | 4 ++- appveyor.yml | 2 +- run-tests.sh | 86 +++++++++++++++++++++++++++++++------------- tests/test_pipenv.py | 13 ------- 4 files changed, 65 insertions(+), 40 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7db8cc1f..9ba03484 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,9 @@ install: script: - 'if [[ -n "$RUN_INTEGRATION_TESTS" ]]; then rm -fr ~/.cache/pip; fi' - 'export PYPI_VENDOR_DIR="$(pwd)/tests/pypi/"' - - 'pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" --tap-stream' + - 'pip install -e "$(pwd)" --upgrade' + - 'pipenv install --deploy --system --dev' + - 'pipenv run time pytest -v -n 4 -m "$TEST_SUITE" tests --tap-stream' jobs: include: diff --git a/appveyor.yml b/appveyor.yml index 96c4478e..281be915 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -54,4 +54,4 @@ cache: test_script: - 'if "%RUN_INTEGRATION_TESTS%" == "True" (rmdir /s /q %LocalAppData%\pip\cache)' - - '%PYTHON%\python.exe -m pipenv run pytest -v -n auto -m "%TEST_SUITE%" tests' + - '%PYTHON%\python.exe -m pipenv run pytest -v -n 4 -m "%TEST_SUITE%" tests' diff --git a/run-tests.sh b/run-tests.sh index 15928880..92dadae5 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -5,36 +5,72 @@ set -eo pipefail # Set the PYPI vendor URL for pytest-pypi. -export PYPI_VENDOR_DIR="$(pwd)/tests/pypi/" +PYPI_VENDOR_DIR="$(pwd)/tests/pypi/" +export PYPI_VENDOR_DIR + +prefix() { + sed "s/^/ $1: /" +} if [[ ! -z "$TEST_SUITE" ]]; then - echo "Using TEST_SUITE=$TEST_SUITE" + echo "Using TEST_SUITE=$TEST_SUITE" fi -# First, try MacOS… -echo "Clearing Caches…" -if [[ $(python -c "import sys; print(sys.platform)") == "darwin" ]]; then - CACHE_ROOT=~/Library/Caches -# Otherwise, assume Linux… +# If running in CI environment… +if [[ ! -z "$CI" ]]; then + echo "Running in a CI environment…" + + # Use tap output for tests. + TAP_OUTPUT="1" + export TAP_OUTPUT + + echo "Installing Pipenv…" + + + pip install -e "$(pwd)" --upgrade + pipenv install --deploy --system --dev + +# Otherwise, we're on a development machine. else - CACHE_ROOT=~/.cache + # 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 + + # If the lockfile hasn't changed, skip installs. + + echo "Installing Pipenv…" + pip install -e "$(pwd)" --upgrade-strategy=only-if-needed + + echo "Installing dependencies…" + PIPENV_PYTHON=2.7 pipenv run pip install -e . --upgrade + PIPENV_PYTHON=3.6 pipenv run pip install -e . --upgrade + PIPENV_PYTHON=2.7 pipenv install --dev + PIPENV_PYTHON=3.6 pipenv install --dev + fi -rm -fr ${CACHE_ROOT}/pip -rm -fr ${CACHE_ROOT}/pipenv -# If the lockfile hasn't changed, skip installs. -echo "Installing Pipenv…" -pip install -e "$(pwd)" --upgrade-strategy=only-if-needed +# Use tap output if in a CI environment, otherwise just run the tests. +if [[ "$TAP_OUTPUT" ]]; then + echo "$ pipenv run time pytest -v -n auto tests -m \"$TEST_SUITE\" --tap-stream | tee report-$PYTHON.tap" + pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" --tap-stream | tee report.tap -echo "Installing dependencies…" -PIPENV_PYTHON=2.7 pipenv run pip install -e . --upgrade -PIPENV_PYTHON=3.6 pipenv run pip install -e . --upgrade -PIPENV_PYTHON=2.7 pipenv install --dev -PIPENV_PYTHON=3.6 pipenv install --dev - -echo "Running tests…" -PIPENV_PYTHON=2.7 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" -PIPENV_PYTHON=3.6 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" - -# Cleanup junk. -rm -fr .venv +else + 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 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" + PIPENV_PYTHON=3.6 pipenv run time pytest -v -n auto tests -m "$TEST_SUITE" + # Cleanup junk. + rm -fr .venv +fi diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py index 17be995e..4d6556b3 100644 --- a/tests/test_pipenv.py +++ b/tests/test_pipenv.py @@ -147,13 +147,11 @@ class TestPipenv: """The ultimate testing class.""" @pytest.mark.cli - @py3_only def test_pipenv_where(self, pypi_secure): with PipenvInstance(pypi=pypi_secure) as p: assert normalize_drive(p.path) in p.pipenv('--where').out @pytest.mark.cli - @py3_only def test_pipenv_venv(self): with PipenvInstance() as p: p.pipenv('--python python') @@ -161,7 +159,6 @@ class TestPipenv: assert os.path.isdir(venv_path) @pytest.mark.cli - @py3_only def test_pipenv_py(self): with PipenvInstance() as p: p.pipenv('--python python') @@ -169,7 +166,6 @@ class TestPipenv: assert os.path.basename(python).startswith('python') @pytest.mark.cli - @py3_only def test_pipenv_rm(self): with PipenvInstance() as p: p.pipenv('--python python') @@ -180,7 +176,6 @@ class TestPipenv: assert not os.path.isdir(venv_path) @pytest.mark.cli - @py3_only def test_pipenv_graph(self, pypi): with PipenvInstance(pypi=pypi) as p: p.pipenv('install requests') @@ -188,7 +183,6 @@ class TestPipenv: assert 'requests' in p.pipenv('graph --json').out @pytest.mark.cli - @py3_only def test_pipenv_graph_reverse(self, pypi): with PipenvInstance(pypi=pypi) as p: p.pipenv('install requests==2.18.4') @@ -214,20 +208,17 @@ class TestPipenv: @pytest.mark.cli @needs_internet - @py3_only def test_pipenv_check(self, pypi): with PipenvInstance(pypi=pypi) as p: p.pipenv('install requests==1.0.0') assert 'requests' in p.pipenv('check').out @pytest.mark.cli - @py3_only def test_venv_envs(self): with PipenvInstance() as p: assert p.pipenv('--envs').out @pytest.mark.cli - @py3_only def test_bare_output(self): with PipenvInstance() as p: assert p.pipenv('').out @@ -238,7 +229,6 @@ class TestPipenv: assert p.pipenv('--help').out @pytest.mark.cli - @py3_only def test_man(self): with PipenvInstance() as p: c = p.pipenv('--man') @@ -246,7 +236,6 @@ class TestPipenv: @pytest.mark.cli @pytest.mark.install - @py3_only def test_install_parse_error(self, pypi): with PipenvInstance(pypi=pypi) as p: @@ -1086,7 +1075,6 @@ records = {extras = ["pandas"], version = "==0.5.2"} @pytest.mark.lock @pytest.mark.deploy @pytest.mark.cli - @py3_only def test_deploy_works(self, pypi): with PipenvInstance(pypi=pypi) as p: @@ -1241,7 +1229,6 @@ requests = "==2.14.0" @pytest.mark.cli @pytest.mark.clean - @py3_only def test_clean_on_empty_venv(self, pypi): with PipenvInstance(pypi=pypi) as p: c = p.pipenv('clean') From 983fefdc4c2ab22124954469e7a8082d4bb46da6 Mon Sep 17 00:00:00 2001 From: Oliver Charlesworth Date: Mon, 9 Apr 2018 08:28:36 +0100 Subject: [PATCH 12/12] Replace build stages with matrix --- .travis.yml | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9ba03484..b9c0967f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,36 +1,24 @@ sudo: false dist: trusty -cache: pip language: python python: - "3.6" - "2.7" env: - - TEST_SUITE='not install' + global: + - PYPI_VENDOR_DIR='./tests/pypi/' + - GIT_ASK_YESNO='false' + matrix: + - TEST_SUITE='not install' + - TEST_SUITE='install' + PYTEST_ADDOPTS='--cache-clear' -# command to install dependencies install: - "pip install --upgrade pip" - "pip install -e . --upgrade --upgrade-strategy=only-if-needed" - "pipenv install --dev" - -# command to run the dependencies -script: - - 'if [[ -n "$RUN_INTEGRATION_TESTS" ]]; then rm -fr ~/.cache/pip; fi' - - 'export PYPI_VENDOR_DIR="$(pwd)/tests/pypi/"' - 'pip install -e "$(pwd)" --upgrade' - 'pipenv install --deploy --system --dev' - - 'pipenv run time pytest -v -n 4 -m "$TEST_SUITE" tests --tap-stream' -jobs: - include: - - stage: takes-forever - env: - - TEST_SUITE='install' - - PYTEST_ADDOPTS='--cache-clear' - - RUN_INTEGRATION_TESTS=1 - -stages: - - test - - name: takes-forever - if: branch = master +script: + - 'pipenv run time pytest -v -n 4 -m "$TEST_SUITE" tests'