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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-19 12:08:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-19 12:08:59 +0300
commitc1fc5da123a1fe670e32740669a9d5e59eff38f5 (patch)
tree9e872d4057232aed3e5e0304cdfa04db74ba8464 /spec/lib/gitlab/ci
parent82a708b9f0adca259062555d16a9720f9955993b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/ci')
-rw-r--r--spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb86
1 files changed, 0 insertions, 86 deletions
diff --git a/spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb
deleted file mode 100644
index 2186bf038eb..00000000000
--- a/spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-describe 'Jobs/Test.gitlab-ci.yml' do
- subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/Test') }
-
- describe 'the created pipeline' do
- let_it_be(:user) { create(:admin) }
- let_it_be(:project) { create(:project, :repository) }
-
- let(:default_branch) { 'master' }
- let(:pipeline_ref) { default_branch }
- let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_ref) }
- let(:pipeline) { service.execute!(:push) }
- let(:build_names) { pipeline.builds.pluck(:name) }
-
- before do
- stub_ci_pipeline_yaml_file(template.content)
- allow_any_instance_of(Ci::BuildScheduleWorker).to receive(:perform).and_return(true)
- allow(project).to receive(:default_branch).and_return(default_branch)
- end
-
- context 'on master' do
- it 'creates the test job' do
- expect(build_names).to contain_exactly('test')
- end
- end
-
- context 'on another branch' do
- let(:pipeline_ref) { 'feature' }
-
- it 'creates the test job' do
- expect(build_names).to contain_exactly('test')
- end
- end
-
- context 'on tag' do
- let(:pipeline_ref) { 'v1.0.0' }
-
- it 'creates the test job' do
- expect(pipeline).to be_tag
- expect(build_names).to contain_exactly('test')
- end
- end
-
- context 'on merge request' do
- let(:service) { MergeRequests::CreatePipelineService.new(project, user) }
- let(:merge_request) { create(:merge_request, :simple, source_project: project) }
- let(:pipeline) { service.execute(merge_request) }
-
- it 'has no jobs' do
- expect(pipeline).to be_merge_request_event
- expect(build_names).to be_empty
- end
- end
-
- context 'TEST_DISABLED is set' do
- before do
- create(:ci_variable, key: 'TEST_DISABLED', value: 'true', project: project)
- end
-
- context 'on master' do
- it 'has no jobs' do
- expect { pipeline }.to raise_error(Ci::CreatePipelineService::CreateError)
- end
- end
-
- context 'on another branch' do
- let(:pipeline_ref) { 'feature' }
-
- it 'has no jobs' do
- expect { pipeline }.to raise_error(Ci::CreatePipelineService::CreateError)
- end
- end
-
- context 'on tag' do
- let(:pipeline_ref) { 'v1.0.0' }
-
- it 'has no jobs' do
- expect { pipeline }.to raise_error(Ci::CreatePipelineService::CreateError)
- end
- end
- end
- end
-end