From df74e0fb435047eeb50d0d530c6a3ecd8591e88d Mon Sep 17 00:00:00 2001 From: Mark Williams Date: Mon, 23 Jul 2018 06:12:34 -0700 Subject: [PATCH] Allow testpilot to run/re-run tests individually Summary: - now that list-tests lists the proper options, remove run_as_bundle tags - since the tests aren't bundled, enable re-runs (which will just re-run failed tests) - remove serialize from test/ext cpp tests Reviewed By: ricklavoie Differential Revision: D8837835 fbshipit-source-id: f50a74602c7d191d08cb7c818f8f64be3c565a7a --- hphp/test/DEFS.bzl | 5 +++-- hphp/test/run.php | 13 ++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/hphp/test/DEFS.bzl b/hphp/test/DEFS.bzl index d81c45bb877..59bc8cf25a9 100644 --- a/hphp/test/DEFS.bzl +++ b/hphp/test/DEFS.bzl @@ -49,7 +49,8 @@ def verify_unittest(suite, repo, dir, mode='interp,jit', [] ) if repo: - command.extend(['-r']) + command.extend(['-r', + '--repo-threads', '5']) if relocate != 0: command.extend(['--relocate', '%d' % relocate, '--exclude-pattern', '=/debugger|ext_vsdebug/=']) @@ -106,5 +107,5 @@ def verify_unittest(suite, repo, dir, mode='interp,jit', name=target_name, command=command, deps=deplist, - tags=['serialize', 'run_as_bundle', 'hphp-test'], + tags=['hphp-test'] + (['run_as_bundle'] if cli_server != 0 else []), ) diff --git a/hphp/test/run.php b/hphp/test/run.php index ce222f18127..74b88955f7d 100644 --- a/hphp/test/run.php +++ b/hphp/test/run.php @@ -451,6 +451,7 @@ function get_options($argv) { 'include:' => 'i:', 'include-pattern:' => 'I:', '*repo' => 'r', + '*repo-threads:' => '', '*hhbbc2' => '', '*mode:' => 'm:', '*server' => 's', @@ -744,10 +745,11 @@ function list_tests($files, $options) { $args = implode(' ', $GLOBALS['recorded_options']); foreach (find_tests($files, $options) as $test) { - print Status::jsonEncode(array( - 'args' => $args, - 'name' => $test, - ))."\n"; + print str_replace('\\', '\\\\', + Status::jsonEncode( + array('args' => $args, 'name' => $test) + ) + )."\n"; } } @@ -1051,6 +1053,7 @@ function hphp_cmd($options, $test, $program) { '-vRuntime.ResourceLimit.CoreFileSize=0', '-vRuntime.Eval.EnableIntrinsicsExtension=true', '-vRuntime.Eval.HackCompilerExtractPath='.bin_root().'/hackc_%{schema}', + '-vParserThreadCount=' . ($options['repo-threads'] ?? 1), '--nofork=1 -thhbc -l1 -k1', "-o \"$test.repo\" --program $program.hhbc \"$test\"", $extra_args, @@ -1065,7 +1068,7 @@ function hhbbc_cmd($options, $test, $program) { '--hhbbc', '--no-logging', '--no-cores', - '--parallel-num-threads=1', + '--parallel-num-threads=' . ($options['repo-threads'] ?? 1), '--hack-compiler-extract-path='.bin_root().'/hackc_%{schema}', read_opts_file("$test.hhbbc_opts"), "-o \"$test.repo/$program.hhbbc\" \"$test.repo/$program.hhbc\"", -- 2.11.4.GIT