Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-10-23 13:58:41 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2018-11-05 17:51:57 +0300
commit40397f35771a37a772f86e00d7dc708ddc6d3544 (patch)
tree0aea3cca4b405fc6fc6624474f5593d7f90b5e57 /spec/services/ci/register_job_service_spec.rb
parent90473e064eac21be283e751005e0c7abbdbf9089 (diff)
Allow to make builds soft-archived.
The soft-archived builds cannot be run after some deadline time. The intent is to aggressively recycle old builds after sometime.
Diffstat (limited to 'spec/services/ci/register_job_service_spec.rb')
-rw-r--r--spec/services/ci/register_job_service_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/services/ci/register_job_service_spec.rb b/spec/services/ci/register_job_service_spec.rb
index a6565709641..56e2a405bcd 100644
--- a/spec/services/ci/register_job_service_spec.rb
+++ b/spec/services/ci/register_job_service_spec.rb
@@ -478,6 +478,20 @@ module Ci
it_behaves_like 'validation is not active'
end
end
+
+ context 'when build is degenerated' do
+ let!(:pending_job) { create(:ci_build, :pending, :degenerated, pipeline: pipeline) }
+
+ subject { execute(specific_runner, {}) }
+
+ it 'does not pick the build and drops the build' do
+ expect(subject).to be_nil
+
+ pending_job.reload
+ expect(pending_job).to be_failed
+ expect(pending_job).to be_archived_failure
+ end
+ end
end
describe '#register_success' do