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
path: root/spec/lib
diff options
context:
space:
mode:
authorCédric Tabin <tabin.cedric@gmail.com>2019-09-05 17:50:39 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2019-09-05 17:50:39 +0300
commite195e48638dcc56609436e6fcdd9ad3521501798 (patch)
treef5bef05404ba10a9eeb897f8e9a40725019a8525 /spec/lib
parentbe920a6056b1b2bbc376af43d9aef8df92f090f6 (diff)
New interruptible attribute supported in YAML parsing.
Since it is not possible to dynamically detect if a job is automatically cancellable or not, a this new attribute is necessary. Moreover, it let the maintainer of the repo to adjust the behaviour of the auto cancellation feature to match exactly what he needs.
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/ci/yaml_processor_spec.rb26
-rw-r--r--spec/lib/gitlab/import_export/safe_model_attributes.yml1
2 files changed, 27 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb
index 91c559dcd9b..cf496b79a62 100644
--- a/spec/lib/gitlab/ci/yaml_processor_spec.rb
+++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb
@@ -50,6 +50,32 @@ module Gitlab
end
end
+ describe 'interruptible entry' do
+ describe 'interruptible job' do
+ let(:config) do
+ YAML.dump(rspec: { script: 'rspec', interruptible: true })
+ end
+
+ it { expect(subject[:interruptible]).to be_truthy }
+ end
+
+ describe 'interruptible job with default value' do
+ let(:config) do
+ YAML.dump(rspec: { script: 'rspec' })
+ end
+
+ it { expect(subject).not_to have_key(:interruptible) }
+ end
+
+ describe 'uninterruptible job' do
+ let(:config) do
+ YAML.dump(rspec: { script: 'rspec', interruptible: false })
+ end
+
+ it { expect(subject[:interruptible]).to be_falsy }
+ end
+ end
+
describe 'retry entry' do
context 'when retry count is specified' do
let(:config) do
diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml
index 1386f8822ce..d34c6d2421b 100644
--- a/spec/lib/gitlab/import_export/safe_model_attributes.yml
+++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml
@@ -329,6 +329,7 @@ CommitStatus:
- failure_reason
- scheduled_at
- upstream_pipeline_id
+- interruptible
Ci::Variable:
- id
- project_id