summaryrefslogtreecommitdiff
path: root/cbuildbot/cbuildbot_config_unittest.py
diff options
context:
space:
mode:
authorLuis Lozano <llozano@chromium.org>2014-07-08 12:50:16 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-11 04:58:32 +0000
commitb5054aca76bd9d4978e8e27bb1bfa5116921f93c (patch)
treecbc1cc321643954012578b88a51ff952b6ea92a2 /cbuildbot/cbuildbot_config_unittest.py
parent0639253903dfc526b18470552e98e58bf53c5b2e (diff)
downloadchromite-b5054aca76bd9d4978e8e27bb1bfa5116921f93c.tar.gz
Generate <board>-release-afdo configs automatically.
The release-afdo configs are builders that do profile collection and optimization in the same builder. Useful for developers that want to measure the performance changes caused by their changes. BUG=None. TEST=Verified the config_dump.json changes. Tried daisy-release-afdo try bot. Ran run_tests. Change-Id: I032e39130e8f2a80303a56b24dc38516e39473ec Reviewed-on: https://chromium-review.googlesource.com/207018 Reviewed-by: Aviv Keshet <akeshet@chromium.org> Commit-Queue: Luis Lozano <llozano@chromium.org> Tested-by: Luis Lozano <llozano@chromium.org>
Diffstat (limited to 'cbuildbot/cbuildbot_config_unittest.py')
-rwxr-xr-xcbuildbot/cbuildbot_config_unittest.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/cbuildbot/cbuildbot_config_unittest.py b/cbuildbot/cbuildbot_config_unittest.py
index d9cf25603..17da1d809 100755
--- a/cbuildbot/cbuildbot_config_unittest.py
+++ b/cbuildbot/cbuildbot_config_unittest.py
@@ -339,6 +339,38 @@ class CBuildBotTest(cros_test_lib.MoxTestCase):
self.assertEqual(child_config.afdo_use, prev_value,
msg % (child_config.name, build_name))
+ def testReleaseAFDOConfigs(self):
+ """Verify that <board>-release-afdo config have generate and use children.
+
+ These configs should have a 'generate' and a 'use' child config. Also,
+ any 'generate' and 'use' configs should be children of a release-afdo
+ config.
+ """
+ msg = 'Config %s should have %s as a parent'
+ parent_suffix = cbuildbot_config.CONFIG_TYPE_RELEASE_AFDO
+ generate_suffix = '%s-generate' % parent_suffix
+ use_suffix = '%s-use' % parent_suffix
+ for build_name, config in cbuildbot_config.config.iteritems():
+ if build_name.endswith(parent_suffix):
+ self.assertEqual(len(config.child_configs), 2,
+ 'Config %s should have 2 child configs' % build_name)
+ for child_config in config.child_configs:
+ child_name = child_config.name
+ self.assertTrue(child_name.endswith(generate_suffix) or
+ child_name.endswith(use_suffix),
+ 'Config %s has wrong %s child' %
+ (build_name, child_config))
+ if build_name.endswith(generate_suffix):
+ parent_config_name = build_name.replace(generate_suffix,
+ parent_suffix)
+ self.assertTrue(parent_config_name in cbuildbot_config.config,
+ msg % (build_name, parent_config_name))
+ if build_name.endswith(use_suffix):
+ parent_config_name = build_name.replace(use_suffix,
+ parent_suffix)
+ self.assertTrue(parent_config_name in cbuildbot_config.config,
+ msg % (build_name, parent_config_name))
+
def testNoGrandChildConfigs(self):
"""Verify that no child configs have a child config."""
for build_name, config in cbuildbot_config.config.iteritems():