Skip to content

Commit c08dcc3

Browse files
committed
(CDPE-7090) Add test for failed jobs
1 parent f624ce4 commit c08dcc3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spec/run_cd4pe_job_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@
246246

247247

248248
end
249+
250+
it 'Fails the job if the job script fails' do
251+
File.write(@job_script, "exit 1;")
252+
253+
job_helper = CD4PEJobRunner.new(windows_job: @windows_job, working_dir: @working_dir, job_token: @job_token, web_ui_endpoint: @web_ui_endpoint, job_owner: @job_owner, job_instance_id: @job_instance_id, logger: @logger, secrets: @secrets)
254+
output = job_helper.run_job
255+
256+
expect(output[:job][:exit_code]).to eq(1)
257+
end
249258
end
250259

251260

0 commit comments

Comments
 (0)