def test_as_pipeline_build_step(self): expected = dict( job='some-job', parameters=[ { '$class': 'StringParameterValue', 'name': 'string1', 'value': 'some string', }, { '$class': 'StringParameterValue', 'name': 'string2', 'value': 'some other string', }, { '$class': 'BooleanParameterValue', 'name': 'some_bool', 'value': True, }, { '$class': 'BooleanParameterValue', 'name': 'some_false_bool', 'value': False, }, ] ) params = OrderedDict(( ('string1', 'some string'), ('string2', 'some other string'), ('some_bool', True), ('some_false_bool', False), )) jrc = JobRunSpec('some-job', params) out = jrc.as_pipeline_build_step() assert expected == out
def test_as_properties_file(self, tmpdir): params = OrderedDict(( ('string1', 'some string'), ('string2', 'some other string'), ('some_bool', True), ('some_false_bool', False), )) expected_props = dedent(""" string1=some string string2=some other string some_bool=true some_false_bool=false """).lstrip() jrc = JobRunSpec('some-job', params) out_file = tmpdir.join('output.properties') jrc.as_properties_file(str(out_file)) assert expected_props == out_file.read()
def _schedule_tester_run(self): logger.info('Scheduling testes job run') JobRunSpec(self.tester_job_name(), {}).as_pipeline_build_step_json()
def _cleanup_result_files(): JenkinsTestedChangeList.clean_artifact() JobRunSpec.clean_pipeline_build_step_json()
def get_queue_job_run_spec(self, queue_action, action_arg): return JobRunSpec( job_name=self.queue_job_name(), params=dict(QUEUE_ACTION=queue_action, ACTION_ARG=action_arg), )