Skip to content

bpo-30822: Exclude tzdata from regrtest --all #2775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ matrix:
./venv/bin/python -m pip install -U coverage
script:
# Skip tests that re-run the entire test suite.
- ./venv/bin/python -m coverage run --pylib -m test -uall,-cpu,-tzdata -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn
- ./venv/bin/python -m coverage run --pylib -m test -uall,-cpu -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn
after_script: # Probably should be after_success once test suite updated to run under coverage.py.
# Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files.
- source ./venv/bin/activate
Expand Down Expand Up @@ -95,7 +95,7 @@ script:
# Only run on Linux as the check only needs to be run once.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./python Tools/scripts/patchcheck.py --travis $TRAVIS_PULL_REQUEST; fi
# `-r -w` implicitly provided through `make buildbottest`.
- make buildbottest TESTOPTS="-j4 -uall,-cpu,-tzdata"
- make buildbottest TESTOPTS="-j4 -uall,-cpu"

notifications:
email: false
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/libregrtest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# We import importlib *ASAP* in order to test #15386
import importlib

from test.libregrtest.cmdline import _parse_args, RESOURCE_NAMES
from test.libregrtest.cmdline import _parse_args, RESOURCE_NAMES, ALL_RESOURCES
from test.libregrtest.main import main
15 changes: 12 additions & 3 deletions Lib/test/libregrtest/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,17 @@
"""


RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network',
'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui', 'tzdata')
ALL_RESOURCES = ('audio', 'curses', 'largefile', 'network',
'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui')

# Other resources excluded from --use=all:
#
# - extralagefile (ex: test_zipfile64): really too slow to be enabled
# "by default"
# - tzdata: while needed to validate fully test_datetime, it makes
# test_datetime too slow (15-20 min on some buildbots) and so is disabled by
# default (see bpo-30822).
RESOURCE_NAMES = ALL_RESOURCES + ('extralargefile', 'tzdata')

class _ArgParser(argparse.ArgumentParser):

Expand Down Expand Up @@ -344,7 +353,7 @@ def _parse_args(args, **kwargs):
for a in ns.use:
for r in a:
if r == 'all':
ns.use_resources[:] = RESOURCE_NAMES
ns.use_resources[:] = ALL_RESOURCES
continue
if r == 'none':
del ns.use_resources[:]
Expand Down
13 changes: 12 additions & 1 deletion Lib/test/test_regrtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,26 @@ def test_use(self):
with self.subTest(opt=opt):
ns = libregrtest._parse_args([opt, 'gui,network'])
self.assertEqual(ns.use_resources, ['gui', 'network'])

ns = libregrtest._parse_args([opt, 'gui,none,network'])
self.assertEqual(ns.use_resources, ['network'])
expected = list(libregrtest.RESOURCE_NAMES)

expected = list(libregrtest.ALL_RESOURCES)
expected.remove('gui')
ns = libregrtest._parse_args([opt, 'all,-gui'])
self.assertEqual(ns.use_resources, expected)
self.checkError([opt], 'expected one argument')
self.checkError([opt, 'foo'], 'invalid resource')

# all + a resource not part of "all"
ns = libregrtest._parse_args([opt, 'all,tzdata'])
self.assertEqual(ns.use_resources,
list(libregrtest.ALL_RESOURCES) + ['tzdata'])

# test another resource which is not part of "all"
ns = libregrtest._parse_args([opt, 'extralargefile'])
self.assertEqual(ns.use_resources, ['extralargefile'])

def test_memlimit(self):
for opt in '-M', '--memlimit':
with self.subTest(opt=opt):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
regrtest: Exclude tzdata from regrtest --all. When running the test suite
using --use=all / -u all, exclude tzdata since it makes test_datetime too
slow (15-20 min on some buildbots) which then times out on some buildbots.
Fix also regrtest command line parser to allow passing -u extralargefile to
run test_zipfile64.