| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent aaeeb75 commit b10cce1
12 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ | |||
| 36 | 36 | ||
| 37 | 37 | # Reset this number to 0 on major V8 upgrades. | |
| 38 | 38 | # Increment by one for each non-official patch applied to deps/v8. | |
| 39 | - 'v8_embedder_string': '-node.33', | ||
| 39 | + 'v8_embedder_string': '-node.34', | ||
| 40 | 40 | ||
| 41 | 41 | ##### V8 defaults for Node.js ##### | |
| 42 | 42 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -116,7 +116,7 @@ local function MakeClangCommandLine( | |||
| 116 | 116 | .. " -DV8_INTL_SUPPORT" | |
| 117 | 117 | .. " -I./" | |
| 118 | 118 | .. " -Iinclude/" | |
| 119 | - .. " -Iout/Release/gen" | ||
| 119 | + .. " -Iout/build/gen" | ||
| 120 | 120 | .. " -Ithird_party/icu/source/common" | |
| 121 | 121 | .. " -Ithird_party/icu/source/i18n" | |
| 122 | 122 | .. " " .. arch_options | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,9 +21,9 @@ | |||
| 21 | 21 | ||
| 22 | 22 | assert len(sys.argv) == 2 | |
| 23 | 23 | ||
| 24 | - if not os.path.isfile("out/Release/gen/torque-generated/builtin-definitions-tq.h"): | ||
| 25 | - print("Expected generated headers in out/Release/gen.") | ||
| 26 | - print("Either build v8 in out/Release or change gcmole.lua:115") | ||
| 24 | + if not os.path.isfile("out/build/gen/torque-generated/builtin-definitions-tq.h"): | ||
| 25 | + print("Expected generated headers in out/build/gen.") | ||
| 26 | + print("Either build v8 in out/build or change gcmole.lua:115") | ||
| 27 | 27 | sys.exit(-1) | |
| 28 | 28 | ||
| 29 | 29 | proc = subprocess.Popen( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -575,6 +575,32 @@ def FlattenRunnables(node, node_cb): | |||
| 575 | 575 | raise Exception('Invalid suite configuration.') | |
| 576 | 576 | ||
| 577 | 577 | ||
| 578 | + def find_build_directory(base_path, arch): | ||
| 579 | + """Returns the location of d8 or node in the build output directory. | ||
| 580 | + | ||
| 581 | + This supports a seamless transition between legacy build location | ||
| 582 | + (out/Release) and new build location (out/build). | ||
| 583 | + """ | ||
| 584 | + def is_build(path): | ||
| 585 | + # We support d8 or node as executables. We don't support testing on | ||
| 586 | + # Windows. | ||
| 587 | + return (os.path.isfile(os.path.join(path, 'd8')) or | ||
| 588 | + os.path.isfile(os.path.join(path, 'node'))) | ||
| 589 | + possible_paths = [ | ||
| 590 | + # Location developer wrapper scripts is using. | ||
| 591 | + '%s.release' % arch, | ||
| 592 | + # Current build location on bots. | ||
| 593 | + 'build', | ||
| 594 | + # Legacy build location on bots. | ||
| 595 | + 'Release', | ||
| 596 | + ] | ||
| 597 | + possible_paths = [os.path.join(base_path, p) for p in possible_paths] | ||
| 598 | + actual_paths = filter(is_build, possible_paths) | ||
| 599 | + assert actual_paths, 'No build directory found.' | ||
| 600 | + assert len(actual_paths) == 1, 'Found ambiguous build directories.' | ||
| 601 | + return actual_paths[0] | ||
| 602 | + | ||
| 603 | + | ||
| 578 | 604 | class Platform(object): | |
| 579 | 605 | def __init__(self, args): | |
| 580 | 606 | self.shell_dir = args.shell_dir | |
@@ -881,8 +907,7 @@ def Main(argv): | |||
| 881 | 907 | 'to auto-detect.', default='x64', | |
| 882 | 908 | choices=SUPPORTED_ARCHS + ['auto']) | |
| 883 | 909 | parser.add_argument('--buildbot', | |
| 884 | - help='Adapt to path structure used on buildbots and adds ' | ||
| 885 | - 'timestamps/level to all logged status messages', | ||
| 910 | + help='Deprecated', | ||
| 886 | 911 | default=False, action='store_true') | |
| 887 | 912 | parser.add_argument('-d', '--device', | |
| 888 | 913 | help='The device ID to run Android tests on. If not ' | |
@@ -978,13 +1003,9 @@ def Main(argv): | |||
| 978 | 1003 | ||
| 979 | 1004 | workspace = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | |
| 980 | 1005 | ||
| 981 | - if args.buildbot: | ||
| 982 | - build_config = 'Release' | ||
| 983 | - else: | ||
| 984 | - build_config = '%s.release' % args.arch | ||
| 985 | - | ||
| 986 | 1006 | if args.binary_override_path == None: | |
| 987 | - args.shell_dir = os.path.join(workspace, args.outdir, build_config) | ||
| 1007 | + args.shell_dir = find_build_directory( | ||
| 1008 | + os.path.join(workspace, args.outdir), args.arch) | ||
| 988 | 1009 | default_binary_name = 'd8' | |
| 989 | 1010 | else: | |
| 990 | 1011 | if not os.path.isfile(args.binary_override_path): | |
@@ -998,8 +1019,8 @@ def Main(argv): | |||
| 998 | 1019 | default_binary_name = os.path.basename(args.binary_override_path) | |
| 999 | 1020 | ||
| 1000 | 1021 | if args.outdir_secondary: | |
| 1001 | - args.shell_dir_secondary = os.path.join( | ||
| 1002 | - workspace, args.outdir_secondary, build_config) | ||
| 1022 | + args.shell_dir_secondary = find_build_directory( | ||
| 1023 | + os.path.join(workspace, args.outdir_secondary), args.arch) | ||
| 1003 | 1024 | else: | |
| 1004 | 1025 | args.shell_dir_secondary = None | |
| 1005 | 1026 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,7 @@ | |||
| 6 | 6 | from __future__ import print_function | |
| 7 | 7 | from functools import reduce | |
| 8 | 8 | ||
| 9 | - from collections import OrderedDict | ||
| 9 | + from collections import OrderedDict, namedtuple | ||
| 10 | 10 | import json | |
| 11 | 11 | import multiprocessing | |
| 12 | 12 | import optparse | |
@@ -115,52 +115,35 @@ | |||
| 115 | 115 | ] | |
| 116 | 116 | ||
| 117 | 117 | ||
| 118 | - class ModeConfig(object): | ||
| 119 | - def __init__(self, flags, timeout_scalefactor, status_mode, execution_mode): | ||
| 120 | - self.flags = flags | ||
| 121 | - self.timeout_scalefactor = timeout_scalefactor | ||
| 122 | - self.status_mode = status_mode | ||
| 123 | - self.execution_mode = execution_mode | ||
| 124 | - | ||
| 118 | + ModeConfig = namedtuple( | ||
| 119 | + 'ModeConfig', 'label flags timeout_scalefactor status_mode') | ||
| 125 | 120 | ||
| 126 | 121 | DEBUG_FLAGS = ["--nohard-abort", "--enable-slow-asserts", "--verify-heap"] | |
| 127 | 122 | RELEASE_FLAGS = ["--nohard-abort"] | |
| 128 | - MODES = { | ||
| 129 | - "debug": ModeConfig( | ||
| 130 | - flags=DEBUG_FLAGS, | ||
| 131 | - timeout_scalefactor=4, | ||
| 132 | - status_mode="debug", | ||
| 133 | - execution_mode="debug", | ||
| 134 | - ), | ||
| 135 | - "optdebug": ModeConfig( | ||
| 123 | + | ||
| 124 | + DEBUG_MODE = ModeConfig( | ||
| 125 | + label='debug', | ||
| 136 | 126 | flags=DEBUG_FLAGS, | |
| 137 | 127 | timeout_scalefactor=4, | |
| 138 | 128 | status_mode="debug", | |
| 139 | - execution_mode="debug", | ||
| 140 | - ), | ||
| 141 | - "release": ModeConfig( | ||
| 129 | + ) | ||
| 130 | + | ||
| 131 | + RELEASE_MODE = ModeConfig( | ||
| 132 | + label='release', | ||
| 142 | 133 | flags=RELEASE_FLAGS, | |
| 143 | 134 | timeout_scalefactor=1, | |
| 144 | 135 | status_mode="release", | |
| 145 | - execution_mode="release", | ||
| 146 | - ), | ||
| 147 | - # Normal trybot release configuration. There, dchecks are always on which | ||
| 148 | - # implies debug is set. Hence, the status file needs to assume debug-like | ||
| 149 | - # behavior/timeouts. | ||
| 150 | - "tryrelease": ModeConfig( | ||
| 136 | + ) | ||
| 137 | + | ||
| 138 | + # Normal trybot release configuration. There, dchecks are always on which | ||
| 139 | + # implies debug is set. Hence, the status file needs to assume debug-like | ||
| 140 | + # behavior/timeouts. | ||
| 141 | + TRY_RELEASE_MODE = ModeConfig( | ||
| 142 | + label='release+dchecks', | ||
| 151 | 143 | flags=RELEASE_FLAGS, | |
| 152 | - timeout_scalefactor=1, | ||
| 153 | - status_mode="debug", | ||
| 154 | - execution_mode="release", | ||
| 155 | - ), | ||
| 156 | - # This mode requires v8 to be compiled with dchecks and slow dchecks. | ||
| 157 | - "slowrelease": ModeConfig( | ||
| 158 | - flags=RELEASE_FLAGS + ["--enable-slow-asserts"], | ||
| 159 | - timeout_scalefactor=2, | ||
| 144 | + timeout_scalefactor=4, | ||
| 160 | 145 | status_mode="debug", | |
| 161 | - execution_mode="release", | ||
| 162 | - ), | ||
| 163 | - } | ||
| 146 | + ) | ||
| 164 | 147 | ||
| 165 | 148 | PROGRESS_INDICATORS = { | |
| 166 | 149 | 'verbose': progress.VerboseProgressIndicator, | |
@@ -240,12 +223,29 @@ def __str__(self): | |||
| 240 | 223 | return '\n'.join(detected_options) | |
| 241 | 224 | ||
| 242 | 225 | ||
| 226 | + def _do_load_build_config(outdir, verbose=False): | ||
| 227 | + build_config_path = os.path.join(outdir, "v8_build_config.json") | ||
| 228 | + if not os.path.exists(build_config_path): | ||
| 229 | + if verbose: | ||
| 230 | + print("Didn't find build config: %s" % build_config_path) | ||
| 231 | + raise TestRunnerError() | ||
| 232 | + | ||
| 233 | + with open(build_config_path) as f: | ||
| 234 | + try: | ||
| 235 | + build_config_json = json.load(f) | ||
| 236 | + except Exception: # pragma: no cover | ||
| 237 | + print("%s exists but contains invalid json. Is your build up-to-date?" | ||
| 238 | + % build_config_path) | ||
| 239 | + raise TestRunnerError() | ||
| 240 | + | ||
| 241 | + return BuildConfig(build_config_json) | ||
| 242 | + | ||
| 243 | + | ||
| 243 | 244 | class BaseTestRunner(object): | |
| 244 | 245 | def __init__(self, basedir=None): | |
| 245 | 246 | self.basedir = basedir or BASE_DIR | |
| 246 | 247 | self.outdir = None | |
| 247 | 248 | self.build_config = None | |
| 248 | - self.mode_name = None | ||
| 249 | 249 | self.mode_options = None | |
| 250 | 250 | self.target_os = None | |
| 251 | 251 | ||
@@ -279,7 +279,7 @@ def execute(self, sys_args=None): | |||
| 279 | 279 | tests = self._load_testsuite_generators(args, options) | |
| 280 | 280 | self._setup_env() | |
| 281 | 281 | print(">>> Running tests for %s.%s" % (self.build_config.arch, | |
| 282 | - self.mode_name)) | ||
| 282 | + self.mode_options.label)) | ||
| 283 | 283 | exit_code = self._do_execute(tests, args, options) | |
| 284 | 284 | if exit_code == utils.EXIT_CODE_FAILURES and options.json_test_results: | |
| 285 | 285 | print("Force exit code 0 after failures. Json test results file " | |
@@ -313,9 +313,6 @@ def _add_parser_default_options(self, parser): | |||
| 313 | 313 | default="out") | |
| 314 | 314 | parser.add_option("--arch", | |
| 315 | 315 | help="The architecture to run tests for") | |
| 316 | - parser.add_option("-m", "--mode", | ||
| 317 | - help="The test mode in which to run (uppercase for builds" | ||
| 318 | - " in CI): %s" % MODES.keys()) | ||
| 319 | 316 | parser.add_option("--shell-dir", help="DEPRECATED! Executables from build " | |
| 320 | 317 | "directory will be used") | |
| 321 | 318 | parser.add_option("--test-root", help="Root directory of the test suites", | |
@@ -400,17 +397,21 @@ def _add_parser_options(self, parser): | |||
| 400 | 397 | def _parse_args(self, parser, sys_args): | |
| 401 | 398 | options, args = parser.parse_args(sys_args) | |
| 402 | 399 | ||
| 403 | - if any(map(lambda v: v and ',' in v, | ||
| 404 | - [options.arch, options.mode])): # pragma: no cover | ||
| 405 | - print('Multiple arch/mode are deprecated') | ||
| 400 | + if options.arch and ',' in options.arch: # pragma: no cover | ||
| 401 | + print('Multiple architectures are deprecated') | ||
| 406 | 402 | raise TestRunnerError() | |
| 407 | 403 | ||
| 408 | 404 | return options, args | |
| 409 | 405 | ||
| 410 | 406 | def _load_build_config(self, options): | |
| 411 | 407 | for outdir in self._possible_outdirs(options): | |
| 412 | 408 | try: | |
| 413 | - self.build_config = self._do_load_build_config(outdir, options.verbose) | ||
| 409 | + self.build_config = _do_load_build_config(outdir, options.verbose) | ||
| 410 | + | ||
| 411 | + # In auto-detect mode the outdir is always where we found the build config. | ||
| 412 | + # This ensures that we'll also take the build products from there. | ||
| 413 | + self.outdir = outdir | ||
| 414 | + break | ||
| 414 | 415 | except TestRunnerError: | |
| 415 | 416 | pass | |
| 416 | 417 | ||
@@ -433,26 +434,21 @@ def _load_build_config(self, options): | |||
| 433 | 434 | # Returns possible build paths in order: | |
| 434 | 435 | # gn | |
| 435 | 436 | # outdir | |
| 436 | - # outdir/arch.mode | ||
| 437 | - # Each path is provided in two versions: <path> and <path>/mode for bots. | ||
| 437 | + # outdir on bots | ||
| 438 | 438 | def _possible_outdirs(self, options): | |
| 439 | 439 | def outdirs(): | |
| 440 | 440 | if options.gn: | |
| 441 | 441 | yield self._get_gn_outdir() | |
| 442 | 442 | return | |
| 443 | 443 | ||
| 444 | 444 | yield options.outdir | |
| 445 | - if options.arch and options.mode: | ||
| 446 | - yield os.path.join(options.outdir, | ||
| 447 | - '%s.%s' % (options.arch, options.mode)) | ||
| 445 | + | ||
| 446 | + if os.path.basename(options.outdir) != 'build': | ||
| 447 | + yield os.path.join(options.outdir, 'build') | ||
| 448 | 448 | ||
| 449 | 449 | for outdir in outdirs(): | |
| 450 | 450 | yield os.path.join(self.basedir, outdir) | |
| 451 | 451 | ||
| 452 | - # bot option | ||
| 453 | - if options.mode: | ||
| 454 | - yield os.path.join(self.basedir, outdir, options.mode) | ||
| 455 | - | ||
| 456 | 452 | def _get_gn_outdir(self): | |
| 457 | 453 | gn_out_dir = os.path.join(self.basedir, DEFAULT_OUT_GN) | |
| 458 | 454 | latest_timestamp = -1 | |
@@ -468,51 +464,13 @@ def _get_gn_outdir(self): | |||
| 468 | 464 | print(">>> Latest GN build found: %s" % latest_config) | |
| 469 | 465 | return os.path.join(DEFAULT_OUT_GN, latest_config) | |
| 470 | 466 | ||
| 471 | - def _do_load_build_config(self, outdir, verbose=False): | ||
| 472 | - build_config_path = os.path.join(outdir, "v8_build_config.json") | ||
| 473 | - if not os.path.exists(build_config_path): | ||
| 474 | - if verbose: | ||
| 475 | - print("Didn't find build config: %s" % build_config_path) | ||
| 476 | - raise TestRunnerError() | ||
| 477 | - | ||
| 478 | - with open(build_config_path) as f: | ||
| 479 | - try: | ||
| 480 | - build_config_json = json.load(f) | ||
| 481 | - except Exception: # pragma: no cover | ||
| 482 | - print("%s exists but contains invalid json. Is your build up-to-date?" | ||
| 483 | - % build_config_path) | ||
| 484 | - raise TestRunnerError() | ||
| 485 | - | ||
| 486 | - # In auto-detect mode the outdir is always where we found the build config. | ||
| 487 | - # This ensures that we'll also take the build products from there. | ||
| 488 | - self.outdir = os.path.dirname(build_config_path) | ||
| 489 | - | ||
| 490 | - return BuildConfig(build_config_json) | ||
| 491 | - | ||
| 492 | 467 | def _process_default_options(self, options): | |
| 493 | - # We don't use the mode for more path-magic. | ||
| 494 | - # Therefore transform the bot mode here to fix build_config value. | ||
| 495 | - if options.mode: | ||
| 496 | - options.mode = self._bot_to_v8_mode(options.mode) | ||
| 497 | - | ||
| 498 | - build_config_mode = 'debug' if self.build_config.is_debug else 'release' | ||
| 499 | - if options.mode: | ||
| 500 | - if options.mode not in MODES: # pragma: no cover | ||
| 501 | - print('%s mode is invalid' % options.mode) | ||
| 502 | - raise TestRunnerError() | ||
| 503 | - if MODES[options.mode].execution_mode != build_config_mode: | ||
| 504 | - print ('execution mode (%s) for %s is inconsistent with build config ' | ||
| 505 | - '(%s)' % ( | ||
| 506 | - MODES[options.mode].execution_mode, | ||
| 507 | - options.mode, | ||
| 508 | - build_config_mode)) | ||
| 509 | - raise TestRunnerError() | ||
| 510 | - | ||
| 511 | - self.mode_name = options.mode | ||
| 468 | + if self.build_config.is_debug: | ||
| 469 | + self.mode_options = DEBUG_MODE | ||
| 470 | + elif self.build_config.dcheck_always_on: | ||
| 471 | + self.mode_options = TRY_RELEASE_MODE | ||
| 512 | 472 | else: | |
| 513 | - self.mode_name = build_config_mode | ||
| 514 | - | ||
| 515 | - self.mode_options = MODES[self.mode_name] | ||
| 473 | + self.mode_options = RELEASE_MODE | ||
| 516 | 474 | ||
| 517 | 475 | if options.arch and options.arch != self.build_config.arch: | |
| 518 | 476 | print('--arch value (%s) inconsistent with build config (%s).' % ( | |
@@ -533,15 +491,6 @@ def _process_default_options(self, options): | |||
| 533 | 491 | options.command_prefix = shlex.split(options.command_prefix) | |
| 534 | 492 | options.extra_flags = sum(map(shlex.split, options.extra_flags), []) | |
| 535 | 493 | ||
| 536 | - def _bot_to_v8_mode(self, config): | ||
| 537 | - """Convert build configs from bots to configs understood by the v8 runner. | ||
| 538 | - | ||
| 539 | - V8 configs are always lower case and without the additional _x64 suffix | ||
| 540 | - for 64 bit builds on windows with ninja. | ||
| 541 | - """ | ||
| 542 | - mode = config[:-4] if config.endswith('_x64') else config | ||
| 543 | - return mode.lower() | ||
| 544 | - | ||
| 545 | 494 | def _process_options(self, options): | |
| 546 | 495 | pass | |
| 547 | 496 | ||
@@ -689,9 +638,7 @@ def _get_statusfile_variables(self, options): | |||
| 689 | 638 | "is_clang": self.build_config.is_clang, | |
| 690 | 639 | "is_full_debug": self.build_config.is_full_debug, | |
| 691 | 640 | "mips_arch_variant": mips_arch_variant, | |
| 692 | - "mode": self.mode_options.status_mode | ||
| 693 | - if not self.build_config.dcheck_always_on | ||
| 694 | - else "debug", | ||
| 641 | + "mode": self.mode_options.status_mode, | ||
| 695 | 642 | "msan": self.build_config.msan, | |
| 696 | 643 | "no_harness": options.no_harness, | |
| 697 | 644 | "no_i18n": self.build_config.no_i18n, | |
@@ -804,10 +751,7 @@ def _create_progress_indicators(self, test_count, options): | |||
| 804 | 751 | procs.append(progress.JUnitTestProgressIndicator(options.junitout, | |
| 805 | 752 | options.junittestsuite)) | |
| 806 | 753 | if options.json_test_results: | |
| 807 | - procs.append(progress.JsonTestProgressIndicator( | ||
| 808 | - self.framework_name, | ||
| 809 | - self.build_config.arch, | ||
| 810 | - self.mode_options.execution_mode)) | ||
| 754 | + procs.append(progress.JsonTestProgressIndicator(self.framework_name)) | ||
| 811 | 755 | ||
| 812 | 756 | for proc in procs: | |
| 813 | 757 | proc.configure(options) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -379,10 +379,8 @@ def _duration_results_text(test): | |||
| 379 | 379 | ] | |
| 380 | 380 | ||
| 381 | 381 | assert os.path.exists(options.json_test_results) | |
| 382 | - complete_results = [] | ||
| 383 | 382 | with open(options.json_test_results, "r") as f: | |
| 384 | - complete_results = json.loads(f.read()) | ||
| 385 | - output = complete_results[0] | ||
| 383 | + output = json.load(f) | ||
| 386 | 384 | lines = [] | |
| 387 | 385 | for test in output['slowest_tests']: | |
| 388 | 386 | suffix = '' | |
| Back | FazBrowse Home | New Git URL |
0 commit comments