Skip to content

Commit 35bdb07

Browse files
authored
Don't run stubgen tests by default in runtests.py (python#8403)
The tests are slow (around 56s sequentially on my laptop) and not very likely to break changes not touching stubtest, so it seems reasonable to make them opt-in outside of CI.
1 parent 75dcfc3 commit 35bdb07

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

runtests.py

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,38 @@
2828
MYPYC_EXTERNAL = 'TestExternal'
2929
MYPYC_COMMAND_LINE = 'TestCommandLine'
3030
ERROR_STREAM = 'ErrorStreamSuite'
31-
32-
33-
ALL_NON_FAST = [CMDLINE,
34-
SAMPLES,
35-
TYPESHED,
36-
PEP561,
37-
EVALUATION,
38-
DAEMON,
39-
STUBGEN_CMD,
40-
STUBGEN_PY,
41-
MYPYC_RUN,
42-
MYPYC_RUN_MULTI,
43-
MYPYC_EXTERNAL,
44-
MYPYC_COMMAND_LINE,
45-
ERROR_STREAM]
31+
STUBTEST = 'StubtestUnit'
32+
STUBTEST_MISC = 'StubtestMiscUnit'
33+
STUBTEST_INTEGRATION = 'StubtestIntegration'
34+
35+
36+
ALL_NON_FAST = [
37+
CMDLINE,
38+
SAMPLES,
39+
TYPESHED,
40+
PEP561,
41+
EVALUATION,
42+
DAEMON,
43+
STUBGEN_CMD,
44+
STUBGEN_PY,
45+
MYPYC_RUN,
46+
MYPYC_RUN_MULTI,
47+
MYPYC_EXTERNAL,
48+
MYPYC_COMMAND_LINE,
49+
ERROR_STREAM,
50+
STUBTEST,
51+
STUBTEST_MISC,
52+
STUBTEST_INTEGRATION,
53+
]
4654

4755

4856
# These must be enabled by explicitly including 'mypyc-extra' on the command line.
4957
MYPYC_OPT_IN = [MYPYC_RUN,
5058
MYPYC_RUN_MULTI]
5159

60+
# These must be enabled by explicitly including 'stubtest' on the command line.
61+
STUBTEST_OPT_IN = [STUBTEST, STUBTEST_MISC, STUBTEST_INTEGRATION]
62+
5263
# We split the pytest run into three parts to improve test
5364
# parallelization. Each run should have tests that each take a roughly similar
5465
# time to run.
@@ -76,6 +87,7 @@
7687
# Mypyc tests that aren't run by default, since they are slow and rarely
7788
# fail for commits that don't touch mypyc
7889
'mypyc-extra': 'pytest -k "%s"' % ' or '.join(MYPYC_OPT_IN),
90+
'stubtest': 'pytest -k "%s"' % ' or '.join(STUBTEST_OPT_IN),
7991
}
8092

8193
# Stop run immediately if these commands fail

0 commit comments

Comments
 (0)