def testAppendUseflags(self):
     base_config = config_lib.BuildConfig(useflags=[])
     inherited_config_1 = base_config.derive(
         useflags=config_lib.append_useflags(['foo', 'bar', '-baz']))
     inherited_config_2 = inherited_config_1.derive(
         useflags=config_lib.append_useflags(['-bar', 'baz']))
     self.assertEqual(base_config.useflags, [])
     self.assertEqual(inherited_config_1.useflags, ['-baz', 'bar', 'foo'])
     self.assertEqual(inherited_config_2.useflags, ['-bar', 'baz', 'foo'])
Exemplo n.º 2
0
def ApplyCustomOverrides(site_config):
    """Method with to override specific flags for specific builders.

  Generally try really hard to avoid putting anything here that isn't
  a really special case for a single specific builder. This is performed
  after every other bit of processing, so it always has the final say.

  Args:
    site_config: config_lib.SiteConfig containing builds to have their
                 waterfall values updated.
  """

    overwritten_configs = {
        'lakitu-release':
        config_lib.BuildConfig().apply(
            site_config.templates.lakitu_test_customizations, ),

        # This is the full build of open-source overlay.
        'lakitu-full':
        config_lib.BuildConfig().apply(
            # logging_CrashSender is expected to fail for lakitu-full.
            # See b/111567339 for more details.
            useflags=config_lib.append_useflags(['-tests_logging_CrashSender'
                                                 ]), ),
        'guado_labstation-release': {
            'hw_tests': [],
            # 'hwqual':False,
            'image_test': False,
            # 'images':['test'],
            'signer_tests': False,
            'vm_tests': [],
        },
        'fizz-labstation-release': {
            'hw_tests': [],
            'image_test': False,
            'signer_tests': False,
            'vm_tests': [],
        },
        'betty-pi-arc-pi-android-pfq':
        site_config.templates.tast_vm_android_pfq_tests,

        # There's no amd64-generic-release builder, so we use amd64-generic-full
        # to validate informational Tast tests on amd64-generic:
        # https://crbug.com/946858
        'amd64-generic-full':
        site_config.templates.tast_vm_canary_tests,
        'betty-pi-arc-release':
        site_config.templates.tast_vm_canary_tests,
        'betty-release':
        site_config.templates.tast_vm_canary_tests,
    }

    for config_name, overrides in overwritten_configs.items():
        # TODO: Turn this assert into a unittest.
        # config = site_config[config_name]
        # for k, v in overrides.items():
        #   assert config[k] != v, ('Unnecessary override: %s: %s' %
        #                           (config_name, k))
        site_config[config_name].apply(**overrides)