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

Unified Diff: scripts/master/unittests/master_gen_test.py

Issue 1152093002: Adjust master_gen.PopulateBuildmasterConfig() to look at master_site_config (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: add active_master_cls param to AnnotatorFactory() Created 5 years, 7 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 | « scripts/master/master_gen.py ('k') | scripts/tools/buildbot_tool_templates/tryserver/master.cfg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/unittests/master_gen_test.py
diff --git a/scripts/master/unittests/master_gen_test.py b/scripts/master/unittests/master_gen_test.py
index 168a75eb829e45bf4c060b3f2867ca94cd9c3924..c1680f133ca9533a0a71958b692ee9de3091db27 100755
--- a/scripts/master/unittests/master_gen_test.py
+++ b/scripts/master/unittests/master_gen_test.py
@@ -29,7 +29,7 @@ SAMPLE_BUILDERS_PY = """\
}
},
"git_repo_url": "https://chromium.googlesource.com/test/test.git",
- "master_base_class": "_FakeMaster",
+ "master_base_class": "_FakeMasterBase",
"master_port": 20999,
"master_port_alt": 40999,
"master_type": "waterfall",
@@ -49,16 +49,21 @@ SAMPLE_BUILDERS_PY = """\
"""
-class _FakeMaster(object):
+# This class fakes the base class from master_site_config.py.
+class _FakeMasterBase(object):
in_production = False
is_production_host = False
+
+
+# This class fakes the actual master class in master_site_config.py.
+class _FakeMaster(_FakeMasterBase):
project_name = 'test'
- project_url = 'https://example.com/'
+ master_port = '20999'
+ slave_port = '30999'
+ master_port_alt = '40999'
+ buildbot_url = 'https://build.chromium.org/p/test'
buildbucket_bucket = None
-
- @classmethod
- def GetBotPassword(cls):
- return ''
+ service_account_file = None
class PopulateBuildmasterConfigTest(unittest.TestCase):
@@ -68,7 +73,6 @@ class PopulateBuildmasterConfigTest(unittest.TestCase):
fp.write(SAMPLE_BUILDERS_PY)
fp.close()
- setattr(_FakeMaster, '_FakeMaster', _FakeMaster)
c = {}
master_gen.PopulateBuildmasterConfig(c, fp.name, _FakeMaster)
@@ -87,7 +91,6 @@ class PopulateBuildmasterConfigTest(unittest.TestCase):
fp.write(contents)
fp.close()
- setattr(_FakeMaster, '_FakeMaster', _FakeMaster)
c = {}
master_gen.PopulateBuildmasterConfig(c, fp.name, _FakeMaster)
« no previous file with comments | « scripts/master/master_gen.py ('k') | scripts/tools/buildbot_tool_templates/tryserver/master.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698