def _create_objects(self): # Create build and run modes objects self.build_modes = Modes.create_modes(BuildModes, self.build_modes) self.run_modes = Modes.create_modes(RunModes, self.run_modes) # Walk through build modes enabled on the CLI and append the opts for en_build_mode in self.en_build_modes: build_mode_obj = Modes.find_mode(en_build_mode, self.build_modes) if build_mode_obj is not None: self.pre_build_cmds.extend(build_mode_obj.pre_build_cmds) self.post_build_cmds.extend(build_mode_obj.post_build_cmds) self.build_opts.extend(build_mode_obj.build_opts) self.pre_run_cmds.extend(build_mode_obj.pre_run_cmds) self.post_run_cmds.extend(build_mode_obj.post_run_cmds) self.run_opts.extend(build_mode_obj.run_opts) self.sw_images.extend(build_mode_obj.sw_images) else: log.error( "Mode \"%s\" enabled on the the command line is not defined", en_build_mode) sys.exit(1) # Walk through run modes enabled on the CLI and append the opts for en_run_mode in self.en_run_modes: run_mode_obj = Modes.find_mode(en_run_mode, self.run_modes) if run_mode_obj is not None: self.pre_run_cmds.extend(run_mode_obj.pre_run_cmds) self.post_run_cmds.extend(run_mode_obj.post_run_cmds) self.run_opts.extend(run_mode_obj.run_opts) self.sw_images.extend(run_mode_obj.sw_images) else: log.error( "Mode \"%s\" enabled on the the command line is not defined", en_run_mode) sys.exit(1) # Create tests from given list of items self.tests = Tests.create_tests(self.tests, self) # Regressions # Parse testplan if provided. if self.testplan != "": self.testplan = Testplan(self.testplan, repo_top=Path(self.proj_root)) # Extract tests in each milestone and add them as regression target. self.regressions.extend(self.testplan.get_milestone_regressions()) else: # Create a dummy testplan with no entries. self.testplan = Testplan(None, name=self.name) # Create regressions self.regressions = Regressions.create_regressions( self.regressions, self, self.tests)
def _create_objects(self): # Create build and run modes objects build_modes = Modes.create_modes(BuildModes, getattr(self, "build_modes")) setattr(self, "build_modes", build_modes) run_modes = Modes.create_modes(RunModes, getattr(self, "run_modes")) setattr(self, "run_modes", run_modes) # Walk through build modes enabled on the CLI and append the opts for en_build_mode in self.en_build_modes: build_mode_obj = Modes.find_mode(en_build_mode, build_modes) if build_mode_obj is not None: self.build_opts.extend(build_mode_obj.build_opts) self.run_opts.extend(build_mode_obj.run_opts) else: log.error( "Mode \"%s\" enabled on the the command line is not defined", en_build_mode) sys.exit(1) # Walk through run modes enabled on the CLI and append the opts for en_run_mode in self.en_run_modes: run_mode_obj = Modes.find_mode(en_run_mode, run_modes) if run_mode_obj is not None: self.run_opts.extend(run_mode_obj.run_opts) else: log.error( "Mode \"%s\" enabled on the the command line is not defined", en_run_mode) sys.exit(1) # Create tests from given list of items tests = Tests.create_tests(getattr(self, "tests"), self) setattr(self, "tests", tests) # Regressions # Parse testplan if provided. if self.testplan != "": self.testplan = testplan_utils.parse_testplan(self.testplan) # Extract tests in each milestone and add them as regression target. self.regressions.extend(self.testplan.get_milestone_regressions()) # Create regressions regressions = Regressions.create_regressions( getattr(self, "regressions"), self, tests) setattr(self, "regressions", regressions)