Skip to content
Snippets Groups Projects

Implement exit code functionality for allow_failure

Merged Marius Bobin requested to merge ci-implement-exit-code-functionality into master
Files
2
@@ -4718,9 +4718,13 @@ def run_job_without_exception
create(:ci_build, pipeline: pipeline)
end
subject(:conditionally_allow_failure) do
job.conditionally_allow_failure!(1)
end
context 'when exit_codes are not defined' do
it 'does not change allow_failure' do
expect { job.conditionally_allow_failure!(1) }
expect { conditionally_allow_failure }
.not_to change { job.reload.allow_failure }
end
end
@@ -4732,7 +4736,7 @@ def run_job_without_exception
end
it 'does not change allow_failure' do
expect { job.conditionally_allow_failure!(1) }
expect { conditionally_allow_failure }
.not_to change { job.reload.allow_failure }
end
end
@@ -4744,7 +4748,7 @@ def run_job_without_exception
end
it 'does change allow_failure' do
expect { job.conditionally_allow_failure!(1) }
expect { conditionally_allow_failure }
.to change { job.reload.allow_failure }
end
end
@@ -4758,7 +4762,7 @@ def run_job_without_exception
end
it 'does not change allow_failure' do
expect { job.conditionally_allow_failure!(1) }
expect { conditionally_allow_failure }
.not_to change { job.reload.allow_failure }
end
end
Loading