diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2016-10-14 19:48:42 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2016-10-14 19:48:42 +0300 |
commit | 3f683038294887b25a87d075905cb4944c2ed595 (patch) | |
tree | a292bdd358a58276a63a9bf946af9bccf3711537 /spec/services | |
parent | 9e199fe057a41cc1316cc96b4472c340895e98a9 (diff) | |
parent | 308769f82b19a142f443fb101a01a60c2b19757f (diff) |
Merge branch 'feature/process-pipeline-hooks-asynchronously' into 'master'
Execute pipeline hooks asynchronously
## What does this MR do?
This MR makes it possible to execute pipeline hooks asynchronously, what should help to improve performance of CI pipeline processing.
## What are the relevant issue numbers?
Closes #23056
See merge request !6824
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/create_deployment_service_spec.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/services/create_deployment_service_spec.rb b/spec/services/create_deployment_service_spec.rb index 343b4385bf2..5fe56e7725f 100644 --- a/spec/services/create_deployment_service_spec.rb +++ b/spec/services/create_deployment_service_spec.rb @@ -84,11 +84,22 @@ describe CreateDeploymentService, services: true do expect(subject).to be_persisted end end + + context 'when project was removed' do + let(:project) { nil } + + it 'does not create deployment or environment' do + expect { subject }.not_to raise_error + + expect(Environment.count).to be_zero + expect(Deployment.count).to be_zero + end + end end describe 'processing of builds' do let(:environment) { nil } - + shared_examples 'does not create environment and deployment' do it 'does not create a new environment' do expect { subject }.not_to change { Environment.count } @@ -133,12 +144,12 @@ describe CreateDeploymentService, services: true do context 'without environment specified' do let(:build) { create(:ci_build, project: project) } - + it_behaves_like 'does not create environment and deployment' do subject { build.success } end end - + context 'when environment is specified' do let(:pipeline) { create(:ci_pipeline, project: project) } let(:build) { create(:ci_build, pipeline: pipeline, environment: 'production', options: options) } |