Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: install libcurl & libcurl4-openssl-dev
# these packages are required to build native extensions for the 'patron' gem
run: |
sudo apt-get update
sudo apt-get install -y libcurl4 libcurl4-openssl-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
Expand All @@ -23,6 +28,11 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: install libcurl & libcurl4-openssl-dev
# these packages are required to build native extensions for the 'patron' gem
run: |
sudo apt-get update
sudo apt-get install -y libcurl4 libcurl4-openssl-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
Expand Down
9 changes: 9 additions & 0 deletions spec/run_cd4pe_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@


end

it 'Fails the job if the job script fails' do
File.write(@job_script, "exit 1;")

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)
output = job_helper.run_job

expect(output[:job][:exit_code]).to eq(1)
end
end


Expand Down
2 changes: 1 addition & 1 deletion tasks/run_cd4pe_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def run_with_system(manifest_type)

cmd_to_execute = local_job_script
if (@windows_job)
cmd_to_execute = "powershell \"& {&'#{local_job_script}'}\""
cmd_to_execute = "powershell \"& {&'#{local_job_script}';exit $LASTEXITCODE}\""
end

run_system_cmd(cmd_to_execute)
Expand Down