File tree 3 files changed +38
-6
lines changed
3 files changed +38
-6
lines changed Original file line number Diff line number Diff line change @@ -38,18 +38,34 @@ jobs:
38
38
env :
39
39
- GROUP=1
40
40
- 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
41
48
- env :
42
49
- GROUP=2
43
50
- NEW_RESOLVER=1
51
+ - LAZY_WHEEL=1
44
52
- env :
45
53
- GROUP=3
46
54
- NEW_RESOLVER=1
55
+ - env :
56
+ - GROUP=3
57
+ - NEW_RESOLVER=1
58
+ - LAZY_WHEEL=1
47
59
48
60
fast_finish : true
49
61
allow_failures :
50
62
- env :
51
63
- GROUP=3
52
64
- NEW_RESOLVER=1
65
+ - env :
66
+ - GROUP=3
67
+ - NEW_RESOLVER=1
68
+ - LAZY_WHEEL=1
53
69
54
70
before_install : tools/travis/setup.sh
55
71
install : travis_retry tools/travis/install.sh
Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ def pytest_addoption(parser):
47
47
default = False ,
48
48
help = "run the skipped tests for the new resolver" ,
49
49
)
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
+ )
50
56
parser .addoption (
51
57
"--use-venv" ,
52
58
action = "store_true" ,
@@ -102,12 +108,16 @@ def pytest_collection_modifyitems(config, items):
102
108
@pytest .fixture (scope = "session" , autouse = True )
103
109
def use_new_resolver (request ):
104
110
"""Set environment variable to make pip default to the new resolver.
111
+
112
+ Lazy wheel, an optimization, is also decided here.
105
113
"""
106
114
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 :
110
116
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"
111
121
yield new_resolver
112
122
113
123
Original file line number Diff line number Diff line change 43
43
RESOLVER_SWITCH=' --new-resolver'
44
44
fi
45
45
46
+ if [[ -z " $LAZY_WHEEL " ]]; then
47
+ LAZY_WHEEL_SWITCH=' '
48
+ else
49
+ LAZY_WHEEL_SWITCH=' --lazy-wheel'
50
+ fi
51
+
46
52
# Print the commands run for this test.
47
53
set -x
48
54
if [[ " $GROUP " == " 1" ]]; then
49
55
# Unit tests
50
56
tox -- --use-venv -m unit -n auto
51
57
# Integration tests (not the ones for 'pip install')
52
58
tox -- -m integration -n auto --duration=5 -k " not test_install" \
53
- --use-venv $RESOLVER_SWITCH
59
+ --use-venv $RESOLVER_SWITCH $LAZY_WHEEL_SWITCH
54
60
elif [[ " $GROUP " == " 2" ]]; then
55
61
# Separate Job for running integration tests for 'pip install'
56
62
tox -- -m integration -n auto --duration=5 -k " test_install" \
57
- --use-venv $RESOLVER_SWITCH
63
+ --use-venv $RESOLVER_SWITCH $LAZY_WHEEL_SWITCH
58
64
elif [[ " $GROUP " == " 3" ]]; then
59
65
# Separate Job for tests that fail with the new resolver
60
66
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
62
68
else
63
69
# Non-Testing Jobs should run once
64
70
tox
You can’t perform that action at this time.
0 commit comments