| OLD | NEW |
| 1 # Copyright (C) 2012 Google Inc. All rights reserved. | 1 # Copyright (C) 2012 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 "Bindings": | 526 "Bindings": |
| 527 {"url": "https://src.chromium.org/viewvc/blink/trunk/PerformanceTest
s/Bindings", | 527 {"url": "https://src.chromium.org/viewvc/blink/trunk/PerformanceTest
s/Bindings", |
| 528 "tests": {"event-target-wrapper": EventTargetWrapperTestData.results
}}} | 528 "tests": {"event-target-wrapper": EventTargetWrapperTestData.results
}}} |
| 529 | 529 |
| 530 def test_run_with_json_output(self): | 530 def test_run_with_json_output(self): |
| 531 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', | 531 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', |
| 532 '--test-results-server=some.host']) | 532 '--test-results-server=some.host']) |
| 533 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=True) | 533 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=True) |
| 534 self.assertEqual(self._load_output_json(runner), [{ | 534 self.assertEqual(self._load_output_json(runner), [{ |
| 535 "buildTime": "2013-02-08T15:19:37.460000", "tests": self._event_targ
et_wrapper_and_inspector_results, | 535 "buildTime": "2013-02-08T15:19:37.460000", "tests": self._event_targ
et_wrapper_and_inspector_results, |
| 536 "revisions": {"blink": {"timestamp": "2013-02-01 08:48:05 +0000", "r
evision": "5678"}}}]) | 536 "revisions": {"chromium": {"timestamp": "2013-02-01 08:48:05 +0000",
"revision": "5678"}}}]) |
| 537 | 537 |
| 538 filesystem = port.host.filesystem | 538 filesystem = port.host.filesystem |
| 539 self.assertTrue(filesystem.isfile(runner._output_json_path())) | 539 self.assertTrue(filesystem.isfile(runner._output_json_path())) |
| 540 self.assertTrue(filesystem.isfile(filesystem.splitext(runner._output_jso
n_path())[0] + '.html')) | 540 self.assertTrue(filesystem.isfile(filesystem.splitext(runner._output_jso
n_path())[0] + '.html')) |
| 541 | 541 |
| 542 def test_run_with_description(self): | 542 def test_run_with_description(self): |
| 543 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', | 543 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', |
| 544 '--test-results-server=some.host', '--description', 'some descriptio
n']) | 544 '--test-results-server=some.host', '--description', 'some descriptio
n']) |
| 545 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=True) | 545 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=True) |
| 546 self.assertEqual(self._load_output_json(runner), [{ | 546 self.assertEqual(self._load_output_json(runner), [{ |
| 547 "buildTime": "2013-02-08T15:19:37.460000", "description": "some desc
ription", | 547 "buildTime": "2013-02-08T15:19:37.460000", "description": "some desc
ription", |
| 548 "tests": self._event_target_wrapper_and_inspector_results, | 548 "tests": self._event_target_wrapper_and_inspector_results, |
| 549 "revisions": {"blink": {"timestamp": "2013-02-01 08:48:05 +0000", "r
evision": "5678"}}}]) | 549 "revisions": {"chromium": {"timestamp": "2013-02-01 08:48:05 +0000",
"revision": "5678"}}}]) |
| 550 | 550 |
| 551 def create_runner_and_setup_results_template(self, args=[]): | 551 def create_runner_and_setup_results_template(self, args=[]): |
| 552 runner, port = self.create_runner(args) | 552 runner, port = self.create_runner(args) |
| 553 filesystem = port.host.filesystem | 553 filesystem = port.host.filesystem |
| 554 filesystem.write_text_file(runner._base_path + '/resources/results-templ
ate.html', | 554 filesystem.write_text_file(runner._base_path + '/resources/results-templ
ate.html', |
| 555 'BEGIN<script src="%AbsolutePathToWebKitTrunk%/some.js"></script>' | 555 'BEGIN<script src="%AbsolutePathToWebKitTrunk%/some.js"></script>' |
| 556 '<script src="%AbsolutePathToWebKitTrunk%/other.js"></script><script
>%PeformanceTestsResultsJSON%</script>END') | 556 '<script src="%AbsolutePathToWebKitTrunk%/other.js"></script><script
>%PeformanceTestsResultsJSON%</script>END') |
| 557 filesystem.write_text_file(runner._base_path + '/Dromaeo/resources/droma
eo/web/lib/jquery-1.6.4.js', 'jquery content') | 557 filesystem.write_text_file(runner._base_path + '/Dromaeo/resources/droma
eo/web/lib/jquery-1.6.4.js', 'jquery content') |
| 558 return runner, port | 558 return runner, port |
| 559 | 559 |
| 560 def test_run_respects_no_results(self): | 560 def test_run_respects_no_results(self): |
| 561 runner, port = self.create_runner(args=['--output-json-path=/mock-checko
ut/output.json', | 561 runner, port = self.create_runner(args=['--output-json-path=/mock-checko
ut/output.json', |
| 562 '--test-results-server=some.host', '--no-results']) | 562 '--test-results-server=some.host', '--no-results']) |
| 563 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=False, results_shown=False) | 563 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=False, results_shown=False) |
| 564 self.assertFalse(port.host.filesystem.isfile('/mock-checkout/output.json
')) | 564 self.assertFalse(port.host.filesystem.isfile('/mock-checkout/output.json
')) |
| 565 | 565 |
| 566 def test_run_generates_json_by_default(self): | 566 def test_run_generates_json_by_default(self): |
| 567 runner, port = self.create_runner_and_setup_results_template() | 567 runner, port = self.create_runner_and_setup_results_template() |
| 568 filesystem = port.host.filesystem | 568 filesystem = port.host.filesystem |
| 569 output_json_path = runner._output_json_path() | 569 output_json_path = runner._output_json_path() |
| 570 results_page_path = filesystem.splitext(output_json_path)[0] + '.html' | 570 results_page_path = filesystem.splitext(output_json_path)[0] + '.html' |
| 571 | 571 |
| 572 self.assertFalse(filesystem.isfile(output_json_path)) | 572 self.assertFalse(filesystem.isfile(output_json_path)) |
| 573 self.assertFalse(filesystem.isfile(results_page_path)) | 573 self.assertFalse(filesystem.isfile(results_page_path)) |
| 574 | 574 |
| 575 self._test_run_with_json_output(runner, port.host.filesystem) | 575 self._test_run_with_json_output(runner, port.host.filesystem) |
| 576 | 576 |
| 577 self.assertEqual(self._load_output_json(runner), [{ | 577 self.assertEqual(self._load_output_json(runner), [{ |
| 578 "buildTime": "2013-02-08T15:19:37.460000", "tests": self._event_targ
et_wrapper_and_inspector_results, | 578 "buildTime": "2013-02-08T15:19:37.460000", "tests": self._event_targ
et_wrapper_and_inspector_results, |
| 579 "revisions": {"blink": {"timestamp": "2013-02-01 08:48:05 +0000", "r
evision": "5678"}}}]) | 579 "revisions": {"chromium": {"timestamp": "2013-02-01 08:48:05 +0000",
"revision": "5678"}}}]) |
| 580 | 580 |
| 581 self.assertTrue(filesystem.isfile(output_json_path)) | 581 self.assertTrue(filesystem.isfile(output_json_path)) |
| 582 self.assertTrue(filesystem.isfile(results_page_path)) | 582 self.assertTrue(filesystem.isfile(results_page_path)) |
| 583 | 583 |
| 584 def test_run_merges_output_by_default(self): | 584 def test_run_merges_output_by_default(self): |
| 585 runner, port = self.create_runner_and_setup_results_template() | 585 runner, port = self.create_runner_and_setup_results_template() |
| 586 filesystem = port.host.filesystem | 586 filesystem = port.host.filesystem |
| 587 output_json_path = runner._output_json_path() | 587 output_json_path = runner._output_json_path() |
| 588 | 588 |
| 589 filesystem.write_text_file(output_json_path, '[{"previous": "results"}]'
) | 589 filesystem.write_text_file(output_json_path, '[{"previous": "results"}]'
) |
| 590 | 590 |
| 591 self._test_run_with_json_output(runner, port.host.filesystem) | 591 self._test_run_with_json_output(runner, port.host.filesystem) |
| 592 | 592 |
| 593 self.assertEqual(self._load_output_json(runner), [{"previous": "results"
}, { | 593 self.assertEqual(self._load_output_json(runner), [{"previous": "results"
}, { |
| 594 "buildTime": "2013-02-08T15:19:37.460000", "tests": self._event_targ
et_wrapper_and_inspector_results, | 594 "buildTime": "2013-02-08T15:19:37.460000", "tests": self._event_targ
et_wrapper_and_inspector_results, |
| 595 "revisions": {"blink": {"timestamp": "2013-02-01 08:48:05 +0000", "r
evision": "5678"}}}]) | 595 "revisions": {"chromium": {"timestamp": "2013-02-01 08:48:05 +0000",
"revision": "5678"}}}]) |
| 596 self.assertTrue(filesystem.isfile(filesystem.splitext(output_json_path)[
0] + '.html')) | 596 self.assertTrue(filesystem.isfile(filesystem.splitext(output_json_path)[
0] + '.html')) |
| 597 | 597 |
| 598 def test_run_respects_reset_results(self): | 598 def test_run_respects_reset_results(self): |
| 599 runner, port = self.create_runner_and_setup_results_template(args=["--re
set-results"]) | 599 runner, port = self.create_runner_and_setup_results_template(args=["--re
set-results"]) |
| 600 filesystem = port.host.filesystem | 600 filesystem = port.host.filesystem |
| 601 output_json_path = runner._output_json_path() | 601 output_json_path = runner._output_json_path() |
| 602 | 602 |
| 603 filesystem.write_text_file(output_json_path, '[{"previous": "results"}]'
) | 603 filesystem.write_text_file(output_json_path, '[{"previous": "results"}]'
) |
| 604 | 604 |
| 605 self._test_run_with_json_output(runner, port.host.filesystem) | 605 self._test_run_with_json_output(runner, port.host.filesystem) |
| 606 | 606 |
| 607 self.assertEqual(self._load_output_json(runner), [{ | 607 self.assertEqual(self._load_output_json(runner), [{ |
| 608 "buildTime": "2013-02-08T15:19:37.460000", "tests": self._event_targ
et_wrapper_and_inspector_results, | 608 "buildTime": "2013-02-08T15:19:37.460000", "tests": self._event_targ
et_wrapper_and_inspector_results, |
| 609 "revisions": {"blink": {"timestamp": "2013-02-01 08:48:05 +0000", "r
evision": "5678"}}}]) | 609 "revisions": {"chromium": {"timestamp": "2013-02-01 08:48:05 +0000",
"revision": "5678"}}}]) |
| 610 self.assertTrue(filesystem.isfile(filesystem.splitext(output_json_path)[
0] + '.html')) | 610 self.assertTrue(filesystem.isfile(filesystem.splitext(output_json_path)[
0] + '.html')) |
| 611 pass | 611 pass |
| 612 | 612 |
| 613 def test_run_generates_and_show_results_page(self): | 613 def test_run_generates_and_show_results_page(self): |
| 614 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json']) | 614 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json']) |
| 615 page_shown = [] | 615 page_shown = [] |
| 616 port.show_results_html_file = lambda path: page_shown.append(path) | 616 port.show_results_html_file = lambda path: page_shown.append(path) |
| 617 filesystem = port.host.filesystem | 617 filesystem = port.host.filesystem |
| 618 self._test_run_with_json_output(runner, filesystem, results_shown=False) | 618 self._test_run_with_json_output(runner, filesystem, results_shown=False) |
| 619 | 619 |
| 620 expected_entry = {"buildTime": "2013-02-08T15:19:37.460000", "tests": se
lf._event_target_wrapper_and_inspector_results, | 620 expected_entry = {"buildTime": "2013-02-08T15:19:37.460000", |
| 621 "revisions": {"blink": {"timestamp": "2013-02-01 08:48:05 +0000", "r
evision": "5678"}}} | 621 "tests": self._event_target_wrapper_and_inspector_resu
lts, |
| 622 "revisions": {"chromium": {"timestamp": "2013-02-01 08
:48:05 +0000", "revision": "5678"}}} |
| 622 | 623 |
| 623 self.maxDiff = None | 624 self.maxDiff = None |
| 624 self.assertEqual(runner._output_json_path(), '/mock-checkout/output.json
') | 625 self.assertEqual(runner._output_json_path(), '/mock-checkout/output.json
') |
| 625 self.assertEqual(self._load_output_json(runner), [expected_entry]) | 626 self.assertEqual(self._load_output_json(runner), [expected_entry]) |
| 626 self.assertEqual(filesystem.read_text_file('/mock-checkout/output.html')
, | 627 self.assertEqual(filesystem.read_text_file('/mock-checkout/output.html')
, |
| 627 'BEGIN<script src="/test.checkout/some.js"></script><script src="/te
st.checkout/other.js"></script>' | 628 'BEGIN<script src="/test.checkout/some.js"></script><script src="/te
st.checkout/other.js"></script>' |
| 628 '<script>%s</script>END' % port.host.filesystem.read_text_file(runne
r._output_json_path())) | 629 '<script>%s</script>END' % port.host.filesystem.read_text_file(runne
r._output_json_path())) |
| 629 self.assertEqual(page_shown[0], '/mock-checkout/output.html') | 630 self.assertEqual(page_shown[0], '/mock-checkout/output.html') |
| 630 | 631 |
| 631 self._test_run_with_json_output(runner, filesystem, results_shown=False) | 632 self._test_run_with_json_output(runner, filesystem, results_shown=False) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 658 port.host.filesystem.write_text_file('/mock-checkout/output.json', '{"an
other bad json": "1"}') | 659 port.host.filesystem.write_text_file('/mock-checkout/output.json', '{"an
other bad json": "1"}') |
| 659 self._test_run_with_json_output(runner, port.host.filesystem, expected_e
xit_code=PerfTestsRunner.EXIT_CODE_BAD_MERGE) | 660 self._test_run_with_json_output(runner, port.host.filesystem, expected_e
xit_code=PerfTestsRunner.EXIT_CODE_BAD_MERGE) |
| 660 | 661 |
| 661 def test_run_with_slave_config_json(self): | 662 def test_run_with_slave_config_json(self): |
| 662 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', | 663 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', |
| 663 '--slave-config-json-path=/mock-checkout/slave-config.json', '--test
-results-server=some.host']) | 664 '--slave-config-json-path=/mock-checkout/slave-config.json', '--test
-results-server=some.host']) |
| 664 port.host.filesystem.write_text_file('/mock-checkout/slave-config.json',
'{"key": "value"}') | 665 port.host.filesystem.write_text_file('/mock-checkout/slave-config.json',
'{"key": "value"}') |
| 665 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=True) | 666 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=True) |
| 666 self.assertEqual(self._load_output_json(runner), [{ | 667 self.assertEqual(self._load_output_json(runner), [{ |
| 667 "buildTime": "2013-02-08T15:19:37.460000", "tests": self._event_targ
et_wrapper_and_inspector_results, | 668 "buildTime": "2013-02-08T15:19:37.460000", "tests": self._event_targ
et_wrapper_and_inspector_results, |
| 668 "revisions": {"blink": {"timestamp": "2013-02-01 08:48:05 +0000", "r
evision": "5678"}}, "builderKey": "value"}]) | 669 "revisions": {"chromium": {"timestamp": "2013-02-01 08:48:05 +0000",
"revision": "5678"}}, "builderKey": "value"}]) |
| 669 | 670 |
| 670 def test_run_with_bad_slave_config_json(self): | 671 def test_run_with_bad_slave_config_json(self): |
| 671 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', | 672 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', |
| 672 '--slave-config-json-path=/mock-checkout/slave-config.json', '--test
-results-server=some.host']) | 673 '--slave-config-json-path=/mock-checkout/slave-config.json', '--test
-results-server=some.host']) |
| 673 logs = self._test_run_with_json_output(runner, port.host.filesystem, exp
ected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON) | 674 logs = self._test_run_with_json_output(runner, port.host.filesystem, exp
ected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON) |
| 674 self.assertTrue('Missing slave configuration JSON file: /mock-checkout/s
lave-config.json' in logs) | 675 self.assertTrue('Missing slave configuration JSON file: /mock-checkout/s
lave-config.json' in logs) |
| 675 port.host.filesystem.write_text_file('/mock-checkout/slave-config.json',
'bad json') | 676 port.host.filesystem.write_text_file('/mock-checkout/slave-config.json',
'bad json') |
| 676 self._test_run_with_json_output(runner, port.host.filesystem, expected_e
xit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON) | 677 self._test_run_with_json_output(runner, port.host.filesystem, expected_e
xit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON) |
| 677 port.host.filesystem.write_text_file('/mock-checkout/slave-config.json',
'["another bad json"]') | 678 port.host.filesystem.write_text_file('/mock-checkout/slave-config.json',
'["another bad json"]') |
| 678 self._test_run_with_json_output(runner, port.host.filesystem, expected_e
xit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON) | 679 self._test_run_with_json_output(runner, port.host.filesystem, expected_e
xit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON) |
| 679 | 680 |
| 680 def test_run_with_multiple_repositories(self): | 681 def test_run_with_multiple_repositories(self): |
| 681 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', | 682 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', |
| 682 '--test-results-server=some.host']) | 683 '--test-results-server=some.host']) |
| 683 port.repository_paths = lambda: [('webkit', '/mock-checkout'), ('some',
'/mock-checkout/some')] | 684 port.repository_path = lambda: '/mock-checkout' |
| 684 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=True) | 685 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=True) |
| 685 self.assertEqual(self._load_output_json(runner), [{ | 686 self.assertEqual(self._load_output_json(runner), [{ |
| 686 "buildTime": "2013-02-08T15:19:37.460000", "tests": self._event_targ
et_wrapper_and_inspector_results, | 687 "buildTime": "2013-02-08T15:19:37.460000", "tests": self._event_targ
et_wrapper_and_inspector_results, |
| 687 "revisions": {"webkit": {"timestamp": "2013-02-01 08:48:05 +0000", "
revision": "5678"}, | 688 "revisions": {"chromium": {"timestamp": "2013-02-01 08:48:05 +0000",
"revision": "5678"}}}]) |
| 688 "some": {"timestamp": "2013-02-01 08:48:05 +0000", "revision": "5678
"}}}]) | |
| 689 | 689 |
| 690 def test_run_with_upload_json(self): | 690 def test_run_with_upload_json(self): |
| 691 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', | 691 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', |
| 692 '--test-results-server', 'some.host', '--platform', 'platform1', '--
builder-name', 'builder1', '--build-number', '123']) | 692 '--test-results-server', 'some.host', '--platform', 'platform1', '--
builder-name', 'builder1', '--build-number', '123']) |
| 693 | 693 |
| 694 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=True) | 694 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=True) |
| 695 generated_json = json.loads(port.host.filesystem.files['/mock-checkout/o
utput.json']) | 695 generated_json = json.loads(port.host.filesystem.files['/mock-checkout/o
utput.json']) |
| 696 self.assertEqual(generated_json[0]['platform'], 'platform1') | 696 self.assertEqual(generated_json[0]['platform'], 'platform1') |
| 697 self.assertEqual(generated_json[0]['builderName'], 'builder1') | 697 self.assertEqual(generated_json[0]['builderName'], 'builder1') |
| 698 self.assertEqual(generated_json[0]['buildNumber'], 123) | 698 self.assertEqual(generated_json[0]['buildNumber'], 123) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 710 self.assertTrue(isinstance(generated_json, list)) | 710 self.assertTrue(isinstance(generated_json, list)) |
| 711 self.assertEqual(len(generated_json), 1) | 711 self.assertEqual(len(generated_json), 1) |
| 712 | 712 |
| 713 output = generated_json[0] | 713 output = generated_json[0] |
| 714 self.maxDiff = None | 714 self.maxDiff = None |
| 715 self.assertEqual(output['platform'], 'platform1') | 715 self.assertEqual(output['platform'], 'platform1') |
| 716 self.assertEqual(output['buildNumber'], 123) | 716 self.assertEqual(output['buildNumber'], 123) |
| 717 self.assertEqual(output['buildTime'], '2013-02-08T15:19:37.460000') | 717 self.assertEqual(output['buildTime'], '2013-02-08T15:19:37.460000') |
| 718 self.assertEqual(output['builderName'], 'builder1') | 718 self.assertEqual(output['builderName'], 'builder1') |
| 719 self.assertEqual(output['builderKey'], 'value1') | 719 self.assertEqual(output['builderKey'], 'value1') |
| 720 self.assertEqual(output['revisions'], {'blink': {'revision': '5678', 'ti
mestamp': '2013-02-01 08:48:05 +0000'}}) | 720 self.assertEqual(output['revisions'], {'chromium': {'revision': '5678',
'timestamp': '2013-02-01 08:48:05 +0000'}}) |
| 721 self.assertEqual(output['tests'].keys(), ['Bindings']) | 721 self.assertEqual(output['tests'].keys(), ['Bindings']) |
| 722 self.assertEqual(sorted(output['tests']['Bindings'].keys()), ['tests', '
url']) | 722 self.assertEqual(sorted(output['tests']['Bindings'].keys()), ['tests', '
url']) |
| 723 self.assertEqual(output['tests']['Bindings']['url'], 'https://src.chromi
um.org/viewvc/blink/trunk/PerformanceTests/Bindings') | 723 self.assertEqual(output['tests']['Bindings']['url'], 'https://src.chromi
um.org/viewvc/blink/trunk/PerformanceTests/Bindings') |
| 724 self.assertEqual(output['tests']['Bindings']['tests'].keys(), ['event-ta
rget-wrapper']) | 724 self.assertEqual(output['tests']['Bindings']['tests'].keys(), ['event-ta
rget-wrapper']) |
| 725 self.assertEqual(output['tests']['Bindings']['tests']['event-target-wrap
per'], { | 725 self.assertEqual(output['tests']['Bindings']['tests']['event-target-wrap
per'], { |
| 726 'url': 'https://src.chromium.org/viewvc/blink/trunk/PerformanceTests
/Bindings/event-target-wrapper.html', | 726 'url': 'https://src.chromium.org/viewvc/blink/trunk/PerformanceTests
/Bindings/event-target-wrapper.html', |
| 727 'metrics': {'Time': {'current': [[1486.0, 1471.0, 1510.0, 1505.0, 14
78.0, 1490.0]] * 4}}}) | 727 'metrics': {'Time': {'current': [[1486.0, 1471.0, 1510.0, 1505.0, 14
78.0, 1490.0]] * 4}}}) |
| 728 | 728 |
| 729 def test_run_with_repeat(self): | 729 def test_run_with_repeat(self): |
| 730 self.maxDiff = None | 730 self.maxDiff = None |
| 731 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', | 731 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', |
| 732 '--test-results-server=some.host', '--repeat', '5']) | 732 '--test-results-server=some.host', '--repeat', '5']) |
| 733 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=True, repeat=5) | 733 self._test_run_with_json_output(runner, port.host.filesystem, upload_suc
ceeds=True, repeat=5) |
| 734 self.assertEqual(self._load_output_json(runner), [ | 734 self.assertEqual(self._load_output_json(runner), [ |
| 735 {"buildTime": "2013-02-08T15:19:37.460000", | 735 {"buildTime": "2013-02-08T15:19:37.460000", |
| 736 "tests": self._event_target_wrapper_and_inspector_results, | 736 "tests": self._event_target_wrapper_and_inspector_results, |
| 737 "revisions": {"blink": {"timestamp": "2013-02-01 08:48:05 +0000", "r
evision": "5678"}}}, | 737 "revisions": {"chromium": {"timestamp": "2013-02-01 08:48:05 +0000"
, "revision": "5678"}}}, |
| 738 {"buildTime": "2013-02-08T15:19:37.460000", | 738 {"buildTime": "2013-02-08T15:19:37.460000", |
| 739 "tests": self._event_target_wrapper_and_inspector_results, | 739 "tests": self._event_target_wrapper_and_inspector_results, |
| 740 "revisions": {"blink": {"timestamp": "2013-02-01 08:48:05 +0000", "r
evision": "5678"}}}, | 740 "revisions": {"chromium": {"timestamp": "2013-02-01 08:48:05 +0000"
, "revision": "5678"}}}, |
| 741 {"buildTime": "2013-02-08T15:19:37.460000", | 741 {"buildTime": "2013-02-08T15:19:37.460000", |
| 742 "tests": self._event_target_wrapper_and_inspector_results, | 742 "tests": self._event_target_wrapper_and_inspector_results, |
| 743 "revisions": {"blink": {"timestamp": "2013-02-01 08:48:05 +0000", "r
evision": "5678"}}}, | 743 "revisions": {"chromium": {"timestamp": "2013-02-01 08:48:05 +0000"
, "revision": "5678"}}}, |
| 744 {"buildTime": "2013-02-08T15:19:37.460000", | 744 {"buildTime": "2013-02-08T15:19:37.460000", |
| 745 "tests": self._event_target_wrapper_and_inspector_results, | 745 "tests": self._event_target_wrapper_and_inspector_results, |
| 746 "revisions": {"blink": {"timestamp": "2013-02-01 08:48:05 +0000", "r
evision": "5678"}}}, | 746 "revisions": {"chromium": {"timestamp": "2013-02-01 08:48:05 +0000"
, "revision": "5678"}}}, |
| 747 {"buildTime": "2013-02-08T15:19:37.460000", | 747 {"buildTime": "2013-02-08T15:19:37.460000", |
| 748 "tests": self._event_target_wrapper_and_inspector_results, | 748 "tests": self._event_target_wrapper_and_inspector_results, |
| 749 "revisions": {"blink": {"timestamp": "2013-02-01 08:48:05 +0000", "r
evision": "5678"}}}]) | 749 "revisions": {"chromium": {"timestamp": "2013-02-01 08:48:05 +0000"
, "revision": "5678"}}}]) |
| 750 | 750 |
| 751 def test_run_with_test_runner_count(self): | 751 def test_run_with_test_runner_count(self): |
| 752 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', | 752 runner, port = self.create_runner_and_setup_results_template(args=['--ou
tput-json-path=/mock-checkout/output.json', |
| 753 '--test-runner-count=3']) | 753 '--test-runner-count=3']) |
| 754 self._test_run_with_json_output(runner, port.host.filesystem, compare_lo
gs=False) | 754 self._test_run_with_json_output(runner, port.host.filesystem, compare_lo
gs=False) |
| 755 generated_json = json.loads(port.host.filesystem.files['/mock-checkout/o
utput.json']) | 755 generated_json = json.loads(port.host.filesystem.files['/mock-checkout/o
utput.json']) |
| 756 self.assertTrue(isinstance(generated_json, list)) | 756 self.assertTrue(isinstance(generated_json, list)) |
| 757 self.assertEqual(len(generated_json), 1) | 757 self.assertEqual(len(generated_json), 1) |
| 758 | 758 |
| 759 output = generated_json[0]['tests']['Bindings']['tests']['event-target-w
rapper']['metrics']['Time']['current'] | 759 output = generated_json[0]['tests']['Bindings']['tests']['event-target-w
rapper']['metrics']['Time']['current'] |
| 760 self.assertEqual(len(output), 3) | 760 self.assertEqual(len(output), 3) |
| 761 expectedMetrics = EventTargetWrapperTestData.results['metrics']['Time'][
'current'][0] | 761 expectedMetrics = EventTargetWrapperTestData.results['metrics']['Time'][
'current'][0] |
| 762 for metrics in output: | 762 for metrics in output: |
| 763 self.assertEqual(metrics, expectedMetrics) | 763 self.assertEqual(metrics, expectedMetrics) |
| OLD | NEW |