| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 unittest | 5 import unittest |
| 6 | 6 |
| 7 from webkitpy.common.host_mock import MockHost | 7 from webkitpy.common.host_mock import MockHost |
| 8 from webkitpy.common.system.executive_mock import MockExecutive | 8 from webkitpy.common.system.executive_mock import MockExecutive |
| 9 from webkitpy.w3c.chromium_commit import ChromiumCommit | 9 from webkitpy.w3c.chromium_commit import ChromiumCommit |
| 10 from webkitpy.w3c.test_exporter import TestExporter | 10 from webkitpy.w3c.test_exporter import TestExporter |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 'footers': 'cr-rev-position', | 92 'footers': 'cr-rev-position', |
| 93 }) | 93 }) |
| 94 test_exporter = TestExporter(self.host, self.wpt_github) | 94 test_exporter = TestExporter(self.host, self.wpt_github) |
| 95 | 95 |
| 96 commits = test_exporter.exportable_commits_since('beefcafe') | 96 commits = test_exporter.exportable_commits_since('beefcafe') |
| 97 self.assertEqual(len(commits), 1) | 97 self.assertEqual(len(commits), 1) |
| 98 self.assertIsInstance(commits[0], ChromiumCommit) | 98 self.assertIsInstance(commits[0], ChromiumCommit) |
| 99 self.assertEqual(self.host.executive.calls, [ | 99 self.assertEqual(self.host.executive.calls, [ |
| 100 ['git', 'clone', 'https://chromium.googlesource.com/external/w3c/web
-platform-tests.git', '/tmp/wpt'], | 100 ['git', 'clone', 'https://chromium.googlesource.com/external/w3c/web
-platform-tests.git', '/tmp/wpt'], |
| 101 ['git', 'rev-parse', '--show-toplevel'], | 101 ['git', 'rev-parse', '--show-toplevel'], |
| 102 ['git', 'rev-list', 'beefcafe..HEAD', '--reverse', '--', | 102 ['git', 'rev-list', 'beefcafe..HEAD', '--reverse', '--', 'badbeef8/t
hird_party/WebKit/LayoutTests/imported/wpt/'], |
| 103 'badbeef8/third_party/WebKit/LayoutTests/imported/wpt/'], | 103 ['git', 'diff-tree', '--name-only', '--no-commit-id', '-r', 'badbeef
8', '--', |
| 104 ['git', 'diff-tree', '--name-only', '--no-commit-id', '-r', | 104 '/mock-checkout/third_party/WebKit/LayoutTests/imported/wpt'], |
| 105 'badbeef8', '--', '/mock-checkout/third_party/WebKit/LayoutTests/im
ported/wpt'], | |
| 106 ['git', 'format-patch', '-1', '--stdout', 'badbeef8', '--', 'some',
'files'], | 105 ['git', 'format-patch', '-1', '--stdout', 'badbeef8', '--', 'some',
'files'], |
| 107 ['git', 'reset', '--hard', 'HEAD'], | 106 ['git', 'reset', '--hard', 'HEAD'], |
| 108 ['git', 'clean', '-fdx'], | 107 ['git', 'clean', '-fdx'], |
| 109 ['git', 'checkout', 'origin/master'], | 108 ['git', 'checkout', 'origin/master'], |
| 109 ['git', 'branch', '-a'], |
| 110 ['git', 'apply', '-'], | 110 ['git', 'apply', '-'], |
| 111 ['git', 'add', '.'], | 111 ['git', 'add', '.'], |
| 112 ['git', 'diff', 'origin/master'], | 112 ['git', 'diff', 'origin/master'], |
| 113 ['git', 'reset', '--hard', 'HEAD'], | 113 ['git', 'reset', '--hard', 'HEAD'], |
| 114 ['git', 'clean', '-fdx'], | 114 ['git', 'clean', '-fdx'], |
| 115 ['git', 'checkout', 'origin/master'], | 115 ['git', 'checkout', 'origin/master'], |
| 116 ['git', 'branch', '-a'], |
| 116 ['git', 'show', '--format=%B', '--no-patch', 'badbeef8'], | 117 ['git', 'show', '--format=%B', '--no-patch', 'badbeef8'], |
| 117 ['git', 'show', '--format=%B', '--no-patch', 'badbeef8']]) | 118 ['git', 'show', '--format=%B', '--no-patch', 'badbeef8']]) |
| 118 | 119 |
| 119 def test_ignores_commits_with_noexport_true(self): | 120 def test_ignores_commits_with_noexport_true(self): |
| 120 self.host.executive = mock_command_exec({ | 121 self.host.executive = mock_command_exec({ |
| 121 'show': 'Commit message\nNOEXPORT=true', | 122 'show': 'Commit message\nNOEXPORT=true', |
| 122 'rev-list': 'badbeef8', | 123 'rev-list': 'badbeef8', |
| 123 'rev-parse': 'badbeef8', | 124 'rev-parse': 'badbeef8', |
| 124 'footers': 'cr-rev-position', | 125 'footers': 'cr-rev-position', |
| 125 }) | 126 }) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 168 |
| 168 commits = test_exporter.exportable_commits_since('beefcafe') | 169 commits = test_exporter.exportable_commits_since('beefcafe') |
| 169 self.assertEqual(len(commits), 0) | 170 self.assertEqual(len(commits), 0) |
| 170 self.assertEqual(self.host.executive.calls, [ | 171 self.assertEqual(self.host.executive.calls, [ |
| 171 ['git', 'clone', 'https://chromium.googlesource.com/external/w3c/web
-platform-tests.git', '/tmp/wpt'], | 172 ['git', 'clone', 'https://chromium.googlesource.com/external/w3c/web
-platform-tests.git', '/tmp/wpt'], |
| 172 ['git', 'rev-parse', '--show-toplevel'], | 173 ['git', 'rev-parse', '--show-toplevel'], |
| 173 ['git', 'rev-list', 'beefcafe..HEAD', '--reverse', '--', | 174 ['git', 'rev-list', 'beefcafe..HEAD', '--reverse', '--', |
| 174 'badbeef8/third_party/WebKit/LayoutTests/imported/wpt/'], | 175 'badbeef8/third_party/WebKit/LayoutTests/imported/wpt/'], |
| 175 ['git', 'diff-tree', '--name-only', '--no-commit-id', '-r', 'badbeef
8', '--', | 176 ['git', 'diff-tree', '--name-only', '--no-commit-id', '-r', 'badbeef
8', '--', |
| 176 '/mock-checkout/third_party/WebKit/LayoutTests/imported/wpt']]) | 177 '/mock-checkout/third_party/WebKit/LayoutTests/imported/wpt']]) |
| OLD | NEW |