diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-16 09:07:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-16 09:07:06 +0000 |
commit | 9c149f7026664e988e69dae31121e6ccc810c6e8 (patch) | |
tree | 7b0a3f6870844a9f81fa3009615aa1f06704a822 /spec/services/ci/create_pipeline_service_spec.rb | |
parent | 077a0d707ff04037e9a3a21391df1c332200e7b9 (diff) | |
download | gitlab-ce-9c149f7026664e988e69dae31121e6ccc810c6e8.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/ci/create_pipeline_service_spec.rb')
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index 42d9774118c..b0ba07ea295 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -760,31 +760,12 @@ RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectnes stub_ci_pipeline_yaml_file(config) end - it 'creates the environment with tags' do + it 'creates the environment with tags', :sidekiq_inline do result = execute_service.payload expect(result).to be_persisted expect(Environment.find_by(name: "review/master")).to be_present expect(result.builds.first.tag_list).to contain_exactly('hello') - end - end - - context 'when create deployment step is synchronous' do - before do - config = YAML.dump( - deploy: { - environment: { name: "review/$CI_COMMIT_REF_NAME" }, - script: 'ls', - tags: ['hello'] - }) - - stub_feature_flags(move_create_deployments_to_worker: false) - stub_ci_pipeline_yaml_file(config) - end - - it 'creates the deployments successfully' do - result = execute_service.payload - expect(result.builds.first.deployment).to be_persisted expect(result.builds.first.deployment.deployable).to be_a(Ci::Build) end @@ -882,11 +863,13 @@ RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectnes stub_ci_pipeline_yaml_file(YAML.dump(ci_yaml)) end - it 'creates a pipeline with the environment' do + it 'creates a pipeline with the environment', :sidekiq_inline do result = execute_service.payload expect(result).to be_persisted expect(Environment.find_by(name: 'production')).to be_present + expect(result.builds.first.deployment).to be_persisted + expect(result.builds.first.deployment.deployable).to be_a(Ci::Build) end end @@ -1329,9 +1312,11 @@ RSpec.describe Ci::CreatePipelineService, :yaml_processor_feature_flag_corectnes } end - it 'has a job with environment' do + it 'has a job with environment', :sidekiq_inline do expect(pipeline.builds.count).to eq(1) expect(pipeline.builds.first.persisted_environment.name).to eq('review/master') + expect(pipeline.builds.first.persisted_environment.name).to eq('review/master') + expect(pipeline.builds.first.deployment).to be_created end end |