diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-17 17:16:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-17 17:16:34 +0300 |
commit | 4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e (patch) | |
tree | 2b256ff8dfe63dafe7f42b0d995f9e74fd1dc48b /spec/services | |
parent | bd860c22f6a4b9473cbddd34a53eead8235a7ea1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 41 |
1 files changed, 6 insertions, 35 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index 6eafe122697..1a5fdac1c95 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -287,51 +287,21 @@ describe Ci::CreatePipelineService do expect(pipeline.builds.find_by(name: 'rspec').interruptible).to be_falsy end end - - context 'not defined, but an environment is' do - before do - config = YAML.dump(rspec: { script: 'echo', environment: { name: "review/$CI_COMMIT_REF_NAME" } }) - stub_ci_pipeline_yaml_file(config) - end - - it 'is not cancelable' do - pipeline = execute_service - - expect(pipeline.builds.find_by(name: 'rspec').interruptible).to be_nil - end - end - - context 'overriding the environment definition' do - before do - config = YAML.dump(rspec: { script: 'echo', environment: { name: "review/$CI_COMMIT_REF_NAME" }, interruptible: true }) - stub_ci_pipeline_yaml_file(config) - end - - it 'is cancelable' do - pipeline = execute_service - - expect(pipeline.builds.find_by(name: 'rspec').interruptible).to be_truthy - end - end end context 'interruptible builds' do before do - Feature.enable(:ci_support_interruptible_pipelines) stub_ci_pipeline_yaml_file(YAML.dump(config)) end - after do - Feature.disable(:ci_support_interruptible_pipelines) - end - let(:config) do { stages: %w[stage1 stage2 stage3 stage4], build_1_1: { stage: 'stage1', - script: 'echo' + script: 'echo', + interruptible: true }, build_1_2: { stage: 'stage1', @@ -342,7 +312,8 @@ describe Ci::CreatePipelineService do stage: 'stage2', script: 'echo', when: 'delayed', - start_in: '10 minutes' + start_in: '10 minutes', + interruptible: true }, build_3_1: { stage: 'stage3', @@ -364,9 +335,9 @@ describe Ci::CreatePipelineService do .pluck(:name, 'ci_builds_metadata.interruptible') expect(interruptible_status).to contain_exactly( - ['build_1_1', nil], + ['build_1_1', true], ['build_1_2', true], - ['build_2_1', nil], + ['build_2_1', true], ['build_3_1', false], ['build_4_1', nil] ) |