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

Unified Diff: tools/mb/mb_unittest.py

Issue 1773883002: Enable all Android builders to use 'chrome_with_codecs'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wmpi_test
Patch Set: Comments. Created 4 years, 9 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
« no previous file with comments | « tools/mb/mb_config.pyl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/mb/mb_unittest.py
diff --git a/tools/mb/mb_unittest.py b/tools/mb/mb_unittest.py
index b836ab048fbc5b97ee3c8d45b967e4e17c2389e9..39678acac63e9bc15b9bcd94f618a574e33af9db 100755
--- a/tools/mb/mb_unittest.py
+++ b/tools/mb/mb_unittest.py
@@ -113,6 +113,7 @@ TEST_CONFIG = """\
'unsupported': ['gn', 'fake_feature2'],
},
'masters': {
+ 'chromium': {},
'fake_master': {
'fake_builder': 'gyp_rel_bot',
'fake_gn_builder': 'gn_rel_bot',
@@ -398,10 +399,64 @@ class UnitTest(unittest.TestCase):
finally:
sys.stdout = orig_stdout
-
def test_validate(self):
self.check(['validate'], ret=0)
+TEST_BAD_CONFIG = """\
+{
+ 'common_dev_configs': ['gn_rel_bot_1'],
+ 'configs': {
+ 'gn_rel_bot_1': ['gn', 'rel', 'chrome_with_codecs'],
+ 'gn_rel_bot_2': ['gn', 'rel', 'bad_nested_config'],
+ },
+ 'masters': {
+ 'chromium': {
+ 'a': 'gn_rel_bot_1',
+ 'b': 'gn_rel_bot_2',
+ },
+ },
+ 'mixins': {
+ 'gn': {'type': 'gn'},
+ 'chrome_with_codecs': {
+ 'gn_args': 'proprietary_codecs=true',
+ },
+ 'bad_nested_config': {
+ 'mixins': ['chrome_with_codecs'],
+ },
+ 'rel': {
+ 'gn_args': 'is_debug=false',
+ },
+ },
+ 'private_configs': ['private'],
+ 'unsupported_configs': ['unsupported'],
+}
+"""
+
+
+TEST_BAD_CONFIG_ERR = """\
+mb config file /fake_src/tools/mb/mb_config.pyl has problems:
+ Config "gn_rel_bot_1" used by a bot is also listed in "common_dev_configs".
+ Unknown config "unsupported" referenced from "unsupported_configs".
+ Unknown config "private" referenced from "private_configs".
+ Public artifact builder "a" can not contain the "chrome_with_codecs" mixin.
+ Public artifact builder "b" can not contain the "chrome_with_codecs" mixin."""
+
+
+class UnitTest2(unittest.TestCase):
+ def fake_mbw(self, files=None, win32=False):
+ mbw = FakeMBW(win32=win32)
+ mbw.files.setdefault(mbw.default_config, TEST_BAD_CONFIG)
+ if files:
+ for path, contents in files.items():
+ mbw.files[path] = contents
+ return mbw
+
+ def test_validate(self):
+ mbw = self.fake_mbw()
Dirk Pranke 2016/03/09 19:47:07 This is, I think, somewhat more complicated than i
DaleCurtis 2016/03/09 21:36:27 Whoops, yeah it was late when I wrote the other co
+ mbw.ParseArgs(['validate'])
+ self.assertRaisesRegexp(Exception, TEST_BAD_CONFIG_ERR, mbw.args.func)
+
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « tools/mb/mb_config.pyl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698