Skip to content

Commit 4db613c

Browse files
committed
Run tests for lazy wheel on Travis
1 parent c127459 commit 4db613c

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

.travis.yml

+16
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,34 @@ jobs:
3838
env:
3939
- GROUP=1
4040
- NEW_RESOLVER=1
41+
- env:
42+
- GROUP=1
43+
- NEW_RESOLVER=1
44+
- LAZY_WHEEL=1
45+
- env:
46+
- GROUP=2
47+
- NEW_RESOLVER=1
4148
- env:
4249
- GROUP=2
4350
- NEW_RESOLVER=1
51+
- LAZY_WHEEL=1
4452
- env:
4553
- GROUP=3
4654
- NEW_RESOLVER=1
55+
- env:
56+
- GROUP=3
57+
- NEW_RESOLVER=1
58+
- LAZY_WHEEL=1
4759

4860
fast_finish: true
4961
allow_failures:
5062
- env:
5163
- GROUP=3
5264
- NEW_RESOLVER=1
65+
- env:
66+
- GROUP=3
67+
- NEW_RESOLVER=1
68+
- LAZY_WHEEL=1
5369

5470
before_install: tools/travis/setup.sh
5571
install: travis_retry tools/travis/install.sh

tests/conftest.py

+13-3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ def pytest_addoption(parser):
4747
default=False,
4848
help="run the skipped tests for the new resolver",
4949
)
50+
parser.addoption(
51+
"--lazy-wheel",
52+
action="store_true",
53+
default=False,
54+
help="use lazy wheels in tests (only affect new resolver)",
55+
)
5056
parser.addoption(
5157
"--use-venv",
5258
action="store_true",
@@ -102,12 +108,16 @@ def pytest_collection_modifyitems(config, items):
102108
@pytest.fixture(scope="session", autouse=True)
103109
def use_new_resolver(request):
104110
"""Set environment variable to make pip default to the new resolver.
111+
112+
Lazy wheel, an optimization, is also decided here.
105113
"""
106114
new_resolver = request.config.getoption("--new-resolver")
107-
if new_resolver:
108-
os.environ["PIP_USE_FEATURE"] = "2020-resolver"
109-
else:
115+
if not new_resolver:
110116
os.environ.pop("PIP_USE_FEATURE", None)
117+
elif request.config.getoption("--lazy-wheel"):
118+
os.environ["PIP_USE_FEATURE"] = "2020-resolver lazy-wheel"
119+
else:
120+
os.environ["PIP_USE_FEATURE"] = "2020-resolver"
111121
yield new_resolver
112122

113123

tools/travis/run.sh

+9-3
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,28 @@ else
4343
RESOLVER_SWITCH='--new-resolver'
4444
fi
4545

46+
if [[ -z "$LAZY_WHEEL" ]]; then
47+
LAZY_WHEEL_SWITCH=''
48+
else
49+
LAZY_WHEEL_SWITCH='--lazy-wheel'
50+
fi
51+
4652
# Print the commands run for this test.
4753
set -x
4854
if [[ "$GROUP" == "1" ]]; then
4955
# Unit tests
5056
tox -- --use-venv -m unit -n auto
5157
# Integration tests (not the ones for 'pip install')
5258
tox -- -m integration -n auto --duration=5 -k "not test_install" \
53-
--use-venv $RESOLVER_SWITCH
59+
--use-venv $RESOLVER_SWITCH $LAZY_WHEEL_SWITCH
5460
elif [[ "$GROUP" == "2" ]]; then
5561
# Separate Job for running integration tests for 'pip install'
5662
tox -- -m integration -n auto --duration=5 -k "test_install" \
57-
--use-venv $RESOLVER_SWITCH
63+
--use-venv $RESOLVER_SWITCH $LAZY_WHEEL_SWITCH
5864
elif [[ "$GROUP" == "3" ]]; then
5965
# Separate Job for tests that fail with the new resolver
6066
tox -- -m fails_on_new_resolver -n auto --duration=5 \
61-
--use-venv $RESOLVER_SWITCH --new-resolver-runtests
67+
--use-venv $RESOLVER_SWITCH --new-resolver-runtests $LAZY_WHEEL_SWITCH
6268
else
6369
# Non-Testing Jobs should run once
6470
tox

0 commit comments

Comments
 (0)