Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d60f002

Browse filesBrowse files
joyeecheungaduh95
authored andcommitted
tools: optimize wildcard execution in tools/test.py
Previously for each matching test, it would execute multiple `node -p` commands to decide the configurations of the executable. That means if there are 100 tests matched, it will run the Node.js executable 4*100 times to retrieve the same configurations repeatedly. This changes the loop order so that it only execute these commands once and reuse the results for all matching tests. PR-URL: #60266 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 4c9a64f commit d60f002
Copy full SHA for d60f002

File tree

Expand file treeCollapse file tree

1 file changed

+22
-21
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+22
-21
lines changed
Open diff view settings
Collapse file

‎tools/test.py‎

Copy file name to clipboardExpand all lines: tools/test.py
+22-21Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,27 +1715,28 @@ def Main():
17151715
all_unused = [ ]
17161716
unclassified_tests = [ ]
17171717
globally_unused_rules = None
1718-
for path in paths:
1719-
for arch in options.arch:
1720-
for mode in options.mode:
1721-
vm = context.GetVm(arch, mode)
1722-
if not exists(vm):
1723-
print("Can't find shell executable: '%s'" % vm)
1724-
continue
1725-
archEngineContext = Execute([vm, "-p", "process.arch"], context)
1726-
vmArch = archEngineContext.stdout.rstrip()
1727-
if archEngineContext.exit_code != 0 or vmArch == "undefined":
1728-
print("Can't determine the arch of: '%s'" % vm)
1729-
print(archEngineContext.stderr.rstrip())
1730-
continue
1731-
env = {
1732-
'mode': mode,
1733-
'system': utils.GuessOS(),
1734-
'arch': vmArch,
1735-
'type': get_env_type(vm, options.type, context),
1736-
'asan': get_asan_state(vm, context),
1737-
'pointer_compression': get_pointer_compression_state(vm, context),
1738-
}
1718+
1719+
for arch in options.arch:
1720+
for mode in options.mode:
1721+
vm = context.GetVm(arch, mode)
1722+
if not exists(vm):
1723+
print("Can't find shell executable: '%s'" % vm)
1724+
continue
1725+
archEngineContext = Execute([vm, "-p", "process.arch"], context)
1726+
vmArch = archEngineContext.stdout.rstrip()
1727+
if archEngineContext.exit_code != 0 or vmArch == "undefined":
1728+
print("Can't determine the arch of: '%s'" % vm)
1729+
print(archEngineContext.stderr.rstrip())
1730+
continue
1731+
env = {
1732+
'mode': mode,
1733+
'system': utils.GuessOS(),
1734+
'arch': vmArch,
1735+
'type': get_env_type(vm, options.type, context),
1736+
'asan': get_asan_state(vm, context),
1737+
'pointer_compression': get_pointer_compression_state(vm, context),
1738+
}
1739+
for path in paths:
17391740
test_list = root.ListTests([], path, context, arch, mode)
17401741
unclassified_tests += test_list
17411742
cases, unused_rules = config.ClassifyTests(test_list, env)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.