8000 bpo-36044: Reduce number of unit tests run for PGO build. by nascheme · Pull Request #14702 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-36044: Reduce number of unit tests run for PGO build. #14702

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 7 commits into from
Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Move default list of PGO tests to own module.
  • Loading branch information
nascheme committed Jul 16, 2019
commit 27be2a95d899e118c1b8a857295fbe26891980ec
58 changes: 3 additions & 55 deletions Lib/test/libregrtest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,59 +17,11 @@
INTERRUPTED, CHILD_ERROR, TEST_DID_NOT_RUN,
PROGRESS_MIN_TIME, format_test_result, is_failed)
from test.libregrtest.setup import setup_tests
from test.libregrtest.pgo import setup_pgo_tests
from test.libregrtest.utils import removepy, count, format_duration, printlist
from test import support


# Set of tests run by default if --pgo is specified. The tests below were
# chosen based on the following criteria: either they exercise a commonly used
# C extension module or type, or they run some relatively typical Python code.
# Long running tests should be avoided because the PGO instrumented executable
# runs slowly.
_PGO_TESTS = [
'test_array',
'test_base64',
'test_binascii',
'test_binop',
'test_bisect',
'test_bytes',
'test_cmath',
'test_codecs',
'test_collections',
'test_complex',
'test_dataclasses',
'test_datetime',
'test_decimal',
'test_difflib',
'test_embed',
'test_float',
'test_fstring',
'test_functools',
'test_generators',
'test_hashlib',
'test_heapq',
'test_int',
'test_itertools',
'test_json',
'test_long',
'test_math',
'test_memoryview',
'test_operator',
'test_ordered_dict',
'test_pickle',
'test_pprint',
'test_re',
'test_set',
'test_statistics',
'test_struct',
'test_tabnanny',
'test_time',
'test_unicode',
'test_xml_etree',
'test_xml_etree_c',
]


class Regrtest:
"""Execute a test suite.

Expand Down Expand Up @@ -263,12 +215,8 @@ def find_tests(self, tests):

removepy(self.tests)

# Add default PGO tests if no tests are specified
if self.ns.pgo and not self.ns.args:
if self.ns.pgo_extended:
pass # will run all tests not marked excluded for PGO
else:
self.ns.args = _PGO_TESTS[:] # run smaller set of tests
# add default PGO tests if no tests are specified
setup_pgo_tests(self.ns)

stdtests = STDTESTS[:]
nottests = NOTTESTS.copy()
Expand Down
52 changes: 52 additions & 0 deletions Lib/test/libregrtest/pgo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Set of tests run by default if --pgo is specified. The tests below were
# chosen based on the following criteria: either they exercise a commonly used
# C extension module or type, or they run some relatively typical Python code.
# Long running tests should be avoided because the PGO instrumented executable
# runs slowly.
PGO_TESTS = [
'test_array',
'test_base64',
'test_binascii',
'test_binop',
'test_bisect',
'test_bytes',
'test_cmath',
'test_codecs',
'test_collections',
'test_complex',
'test_dataclasses',
'test_datetime',
'test_decimal',
'test_difflib',
'test_embed',
'test_float',
'test_fstring',
'test_functools',
'test_generators',
'test_hashlib',
'test_heapq',
'test_int',
'test_itertools',
'test_json',
'test_long',
'test_math',
'test_memoryview',
'test_operator',
'test_ordered_dict',
'test_pickle',
'test_pprint',
'test_re',
'test_set',
'test_statistics',
'test_struct',
'test_tabnanny',
'test_time',
'test_unicode',
'test_xml_etree',
'test_xml_etree_c',
]

def setup_pgo_tests(ns):
if not ns.args and not ns.pgo_extended:
# run default set of tests for PGO training
ns.args = PGO_TESTS[:]
0