OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import re | 5 import re |
6 from recipe_engine.types import freeze | 6 from recipe_engine.types import freeze |
7 | 7 |
8 | 8 |
9 TEST_CONFIGS = freeze({ | 9 TEST_CONFIGS = freeze({ |
10 'benchmarks': { | 10 'benchmarks': { |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 class V8Presubmit(BaseTest): | 344 class V8Presubmit(BaseTest): |
345 def run(self, **kwargs): | 345 def run(self, **kwargs): |
346 self.api.python( | 346 self.api.python( |
347 'Presubmit', | 347 'Presubmit', |
348 self.api.path['checkout'].join('tools', 'presubmit.py'), | 348 self.api.path['checkout'].join('tools', 'presubmit.py'), |
349 cwd=self.api.path['checkout'], | 349 cwd=self.api.path['checkout'], |
350 ) | 350 ) |
351 return TestResults.empty() | 351 return TestResults.empty() |
352 | 352 |
353 | 353 |
354 class V8CheckInitializers(BaseTest): | 354 class V8CheckInitializers(BaseTest): |
Michael Achenbach
2016/01/11 08:37:42
No point keeping the non-swarming version for anyt
tandrii(chromium)
2016/01/11 08:39:52
Acknowledged.
| |
355 def run(self, **kwargs): | |
356 self.api.step( | |
357 'Static-Initializers', | |
358 ['bash', | |
359 self.api.path['checkout'].join('tools', 'check-static-initializers.sh'), | |
360 self.api.path.join( | |
361 self.api.path.basename(self.api.chromium.c.build_dir), | |
362 self.api.chromium.c.build_config_fs, | |
363 'd8'), | |
364 ], | |
365 cwd=self.api.path['checkout'], | |
366 ) | |
367 return TestResults.empty() | |
368 | |
369 | |
370 class V8CheckInitializersSwarming(BaseTest): | |
371 @property | 355 @property |
372 def uses_swarming(self): | 356 def uses_swarming(self): |
373 """Returns true if the test uses swarming.""" | 357 """Returns true if the test uses swarming.""" |
374 return True | 358 return True |
375 | 359 |
376 def pre_run(self, test=None, **kwargs): | 360 def pre_run(self, test=None, **kwargs): |
377 self.test = test or TEST_CONFIGS[self.name] | 361 self.test = test or TEST_CONFIGS[self.name] |
378 self.task = self.api.swarming.task( | 362 self.task = self.api.swarming.task( |
379 title='Static-Initializers', | 363 title='Static-Initializers', |
380 isolated_hash=self._get_isolated_hash(self.test), | 364 isolated_hash=self._get_isolated_hash(self.test), |
381 extra_args=[ | 365 extra_args=[ |
382 self.api.path.join( | 366 self.api.path.join( |
383 self.api.path.basename(self.api.chromium.c.build_dir), | 367 self.api.path.basename(self.api.chromium.c.build_dir), |
384 self.api.chromium.c.build_config_fs, | 368 self.api.chromium.c.build_config_fs, |
385 'd8'), | 369 'd8'), |
386 ], | 370 ], |
387 ) | 371 ) |
372 # Set default value. | |
373 # TODO(machenbach): Merge this code with other swarming tests. | |
374 if 'os' not in self.task.dimensions: | |
375 self.task.dimensions['os'] = self.api.swarming.prefered_os_dimension( | |
376 self.api.platform.name) | |
388 self.api.swarming.trigger_task(self.task) | 377 self.api.swarming.trigger_task(self.task) |
389 | 378 |
390 def run(self, **kwargs): | 379 def run(self, **kwargs): |
391 assert self.task | 380 assert self.task |
392 self.api.swarming.collect_task(self.task) | 381 self.api.swarming.collect_task(self.task) |
393 return TestResults.empty() | 382 return TestResults.empty() |
394 | 383 |
395 | 384 |
396 class V8Fuzzer(BaseTest): | 385 class V8Fuzzer(BaseTest): |
397 def run(self, **kwargs): | 386 def run(self, **kwargs): |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
494 V8_NON_STANDARD_TESTS = freeze({ | 483 V8_NON_STANDARD_TESTS = freeze({ |
495 'deopt': V8DeoptFuzzer, | 484 'deopt': V8DeoptFuzzer, |
496 'fuzz': V8Fuzzer, | 485 'fuzz': V8Fuzzer, |
497 'gcmole': V8GCMole, | 486 'gcmole': V8GCMole, |
498 'presubmit': V8Presubmit, | 487 'presubmit': V8Presubmit, |
499 'simpleleak': V8SimpleLeakCheck, | 488 'simpleleak': V8SimpleLeakCheck, |
500 }) | 489 }) |
501 | 490 |
502 | 491 |
503 TOOL_TO_TEST = freeze({ | 492 TOOL_TO_TEST = freeze({ |
504 'check-static-initializers': V8CheckInitializers, | |
505 'run-tests': V8Test, | 493 'run-tests': V8Test, |
506 }) | 494 }) |
507 | 495 |
508 | 496 |
509 TOOL_TO_TEST_SWARMING = freeze({ | 497 TOOL_TO_TEST_SWARMING = freeze({ |
510 'check-static-initializers': V8CheckInitializersSwarming, | 498 'check-static-initializers': V8CheckInitializers, |
511 'run-tests': V8SwarmingTest, | 499 'run-tests': V8SwarmingTest, |
512 }) | 500 }) |
513 | 501 |
514 | 502 |
515 class Failure(object): | 503 class Failure(object): |
516 def __init__(self, test_step_config, failure_dict, duration): | 504 def __init__(self, test_step_config, failure_dict, duration): |
517 self.test_step_config = test_step_config | 505 self.test_step_config = test_step_config |
518 self.failure_dict = failure_dict | 506 self.failure_dict = failure_dict |
519 self.duration = duration | 507 self.duration = duration |
520 | 508 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
553 # TODO(machenbach): Implement swarming for non-standard tests. | 541 # TODO(machenbach): Implement swarming for non-standard tests. |
554 if v8_api.bot_config.get('enable_swarming') and test_step_config.swarming: | 542 if v8_api.bot_config.get('enable_swarming') and test_step_config.swarming: |
555 tools_mapping = TOOL_TO_TEST_SWARMING | 543 tools_mapping = TOOL_TO_TEST_SWARMING |
556 else: | 544 else: |
557 tools_mapping = TOOL_TO_TEST | 545 tools_mapping = TOOL_TO_TEST |
558 | 546 |
559 # The tool the test is going to use. Default: V8 test runner (run-tests). | 547 # The tool the test is going to use. Default: V8 test runner (run-tests). |
560 tool = TEST_CONFIGS[test_step_config.name].get('tool', 'run-tests') | 548 tool = TEST_CONFIGS[test_step_config.name].get('tool', 'run-tests') |
561 test_cls = tools_mapping[tool] | 549 test_cls = tools_mapping[tool] |
562 return test_cls(test_step_config, api, v8_api) | 550 return test_cls(test_step_config, api, v8_api) |
OLD | NEW |