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

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

Issue 2544173002: Skip commits that don't generate a patch + fixes to get export working (Closed)
Patch Set: Merge ChromiumWPT functionality into TestExporter, expose exportable_commits Created 4 years 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/chromium_commit_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py
index 20fd78e95d0ca610e65321d6f5347196b99bc79d..724c3a23e6f2a22233e46a6d2363f4644aa42c47 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py
@@ -5,7 +5,7 @@
import unittest
from webkitpy.common.host_mock import MockHost
from webkitpy.common.system.executive_mock import MockExecutive2
-from webkitpy.w3c.chromium_commit import ChromiumCommit
+from webkitpy.w3c.chromium_commit import ChromiumCommit, WPT_DIR
class ChromiumCommitTest(unittest.TestCase):
@@ -24,3 +24,31 @@ class ChromiumCommitTest(unittest.TestCase):
self.assertEqual(chromium_commit.position, 'refs/heads/master@{#789}')
self.assertEqual(chromium_commit.sha, 'deadbeefcafe')
+
+ def test_filtered_changed_files_blacklist(self):
+ host = MockHost()
+
+ fake_files = ['file1', 'MANIFEST.json', 'file3']
+ qualified_fake_files = [WPT_DIR + f for f in fake_files]
+
+ stub_commands = {
+ 'diff-tree': '\n'.join(qualified_fake_files),
+ 'crrev-parse': 'fake rev',
+ }
+
+ def mock_command(args):
+ if args[1] in stub_commands:
+ return stub_commands[args[1]]
+ else:
+ raise Exception('Unexpected command called: %s' % args)
+
+ host.executive = MockExecutive2(run_command_fn=mock_command)
+ pos = 'Cr-Commit-Position: refs/heads/master@{#789}'
+ chromium_commit = ChromiumCommit(host, position=pos)
+
+ files = chromium_commit.filtered_changed_files()
+
+ expected_files = ['file1', 'file3']
+ qualified_expected_files = [WPT_DIR + f for f in expected_files]
+
+ self.assertEqual(files, qualified_expected_files)

Powered by Google App Engine
This is Rietveld 408576698