Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1287)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py

Issue 2648783004: Move exportable_commits_since to webkitpy/w3c/common.py. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py
index b8da05cd4d9f97811ef19d98a4ff605827fb658e..a20ba5440ccb4e24a7a3c3c15b928648bc7dc7dd 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py
@@ -6,18 +6,10 @@ import unittest
from webkitpy.common.host_mock import MockHost
from webkitpy.common.system.executive_mock import MockExecutive
-from webkitpy.w3c.chromium_commit import ChromiumCommit
from webkitpy.w3c.test_exporter import TestExporter
from webkitpy.w3c.wpt_github_mock import MockWPTGitHub
-def mock_command_exec(vals):
- def run_fn(args):
- sub_command = args[1]
- return vals.get(sub_command, '')
- return MockExecutive(run_command_fn=run_fn)
-
-
class TestExporterTest(unittest.TestCase):
def setUp(self):
@@ -79,107 +71,3 @@ class TestExporterTest(unittest.TestCase):
self.assertEqual(wpt_github.calls, ['in_flight_pull_requests', 'create_pr'])
self.assertEqual(wpt_github.pull_requests_created,
[('chromium-export-try', 'older fake text', 'older fake text')])
-
- def test_exportable_commits_since(self):
- self.host.executive = mock_command_exec({
- 'show': 'fake message',
- 'rev-list': 'badbeef8',
- 'rev-parse': 'badbeef8',
- 'crrev-parse': 'badbeef8',
- 'diff': 'fake diff',
- 'diff-tree': 'some\nfiles',
- 'format-patch': 'hey I\'m a patch',
- 'footers': 'cr-rev-position',
- })
- test_exporter = TestExporter(self.host, self.wpt_github)
-
- commits = test_exporter.exportable_commits_since('beefcafe')
- self.assertEqual(len(commits), 1)
- self.assertIsInstance(commits[0], ChromiumCommit)
- self.assertEqual(self.host.executive.calls, [
- ['git', 'clone', 'https://chromium.googlesource.com/external/w3c/web-platform-tests.git', '/tmp/wpt'],
- ['git', 'remote'],
- ['git', 'remote', 'add', 'github', 'git@github.com:w3c/web-platform-tests.git'],
- ['git', 'rev-parse', '--show-toplevel'],
- ['git', 'rev-list', 'beefcafe..HEAD', '--reverse', '--', 'badbeef8/third_party/WebKit/LayoutTests/external/wpt/'],
- ['git', 'diff-tree', '--name-only', '--no-commit-id', '-r', 'badbeef8', '--',
- '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt'],
- ['git', 'format-patch', '-1', '--stdout', 'badbeef8', '--', 'some', 'files'],
- ['git', 'reset', '--hard', 'HEAD'],
- ['git', 'clean', '-fdx'],
- ['git', 'checkout', 'origin/master'],
- ['git', 'branch', '-a'],
- ['git', 'apply', '-'],
- ['git', 'add', '.'],
- ['git', 'diff', 'origin/master'],
- ['git', 'reset', '--hard', 'HEAD'],
- ['git', 'clean', '-fdx'],
- ['git', 'checkout', 'origin/master'],
- ['git', 'branch', '-a'],
- ['git', 'show', '--format=%B', '--no-patch', 'badbeef8'],
- ['git', 'show', '--format=%B', '--no-patch', 'badbeef8']])
-
- def test_ignores_commits_with_noexport_true(self):
- self.host.executive = mock_command_exec({
- 'show': 'Commit message\nNOEXPORT=true',
- 'rev-list': 'badbeef8',
- 'rev-parse': 'badbeef8',
- 'footers': 'cr-rev-position',
- })
- test_exporter = TestExporter(self.host, self.wpt_github)
-
- commits = test_exporter.exportable_commits_since('beefcafe')
- self.assertEqual(len(commits), 0)
- self.assertEqual(self.host.executive.calls, [
- ['git', 'clone', 'https://chromium.googlesource.com/external/w3c/web-platform-tests.git', '/tmp/wpt'],
- ['git', 'remote'],
- ['git', 'remote', 'add', 'github', 'git@github.com:w3c/web-platform-tests.git'],
- ['git', 'rev-parse', '--show-toplevel'],
- ['git', 'rev-list', 'beefcafe..HEAD', '--reverse', '--',
- 'badbeef8/third_party/WebKit/LayoutTests/external/wpt/'],
- ['git', 'diff-tree', '--name-only', '--no-commit-id', '-r', 'badbeef8', '--',
- '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt']])
-
- def test_ignores_reverted_commits_with_noexport_true(self):
- self.host.executive = mock_command_exec({
- 'show': 'Commit message\n> NOEXPORT=true',
- 'rev-list': 'badbeef8',
- 'rev-parse': 'badbeef8',
- 'footers': 'cr-rev-position',
- })
- wpt_github = MockWPTGitHub(pull_requests=[])
- test_exporter = TestExporter(self.host, wpt_github)
-
- commits = test_exporter.exportable_commits_since('beefcafe')
- self.assertEqual(len(commits), 0)
- self.assertEqual(self.host.executive.calls, [
- ['git', 'clone', 'https://chromium.googlesource.com/external/w3c/web-platform-tests.git', '/tmp/wpt'],
- ['git', 'remote'],
- ['git', 'remote', 'add', 'github', 'git@github.com:w3c/web-platform-tests.git'],
- ['git', 'rev-parse', '--show-toplevel'],
- ['git', 'rev-list', 'beefcafe..HEAD', '--reverse', '--',
- 'badbeef8/third_party/WebKit/LayoutTests/external/wpt/'],
- ['git', 'diff-tree', '--name-only', '--no-commit-id', '-r', 'badbeef8', '--',
- '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt']])
-
- def test_ignores_commits_that_start_with_import(self):
- self.host.executive = mock_command_exec({
- 'show': 'Import rutabaga@deadbeef',
- 'rev-list': 'badbeef8',
- 'rev-parse': 'badbeef8',
- 'footers': 'cr-rev-position',
- })
- wpt_github = MockWPTGitHub(pull_requests=[])
- test_exporter = TestExporter(self.host, wpt_github)
-
- commits = test_exporter.exportable_commits_since('beefcafe')
- self.assertEqual(len(commits), 0)
- self.assertEqual(self.host.executive.calls, [
- ['git', 'clone', 'https://chromium.googlesource.com/external/w3c/web-platform-tests.git', '/tmp/wpt'],
- ['git', 'remote'],
- ['git', 'remote', 'add', 'github', 'git@github.com:w3c/web-platform-tests.git'],
- ['git', 'rev-parse', '--show-toplevel'],
- ['git', 'rev-list', 'beefcafe..HEAD', '--reverse', '--',
- 'badbeef8/third_party/WebKit/LayoutTests/external/wpt/'],
- ['git', 'diff-tree', '--name-only', '--no-commit-id', '-r', 'badbeef8', '--',
- '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt']])

Powered by Google App Engine
This is Rietveld 408576698