diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 15:09:37 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 15:09:37 +0000 |
commit | 2c89e169769ead722394a79ed67fcd08e96863dd (patch) | |
tree | 0dadb576846c484475b895f75fab41f71cdb952e /spec/models/ci | |
parent | bd497e352ebd279536ae11855871162e82a3f88c (diff) | |
download | gitlab-ce-2c89e169769ead722394a79ed67fcd08e96863dd.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/ci')
-rw-r--r-- | spec/models/ci/bridge_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/ci/build_metadata_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/ci/build_spec.rb | 18 | ||||
-rw-r--r-- | spec/models/ci/build_trace_chunk_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/ci/processable_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/ci/runner_spec.rb | 6 |
6 files changed, 23 insertions, 23 deletions
diff --git a/spec/models/ci/bridge_spec.rb b/spec/models/ci/bridge_spec.rb index c9d6687f0ea..31e13122b95 100644 --- a/spec/models/ci/bridge_spec.rb +++ b/spec/models/ci/bridge_spec.rb @@ -3,9 +3,9 @@ require 'spec_helper' describe Ci::Bridge do - set(:project) { create(:project) } - set(:target_project) { create(:project, name: 'project', namespace: create(:namespace, name: 'my')) } - set(:pipeline) { create(:ci_pipeline, project: project) } + let_it_be(:project) { create(:project) } + let_it_be(:target_project) { create(:project, name: 'project', namespace: create(:namespace, name: 'my')) } + let_it_be(:pipeline) { create(:ci_pipeline, project: project) } let(:bridge) do create(:ci_bridge, :variables, status: :created, diff --git a/spec/models/ci/build_metadata_spec.rb b/spec/models/ci/build_metadata_spec.rb index da95a2d30f5..588e5872cc8 100644 --- a/spec/models/ci/build_metadata_spec.rb +++ b/spec/models/ci/build_metadata_spec.rb @@ -3,11 +3,11 @@ require 'spec_helper' describe Ci::BuildMetadata do - set(:user) { create(:user) } - set(:group) { create(:group) } - set(:project) { create(:project, :repository, group: group, build_timeout: 2000) } + let_it_be(:user) { create(:user) } + let_it_be(:group) { create(:group) } + let_it_be(:project) { create(:project, :repository, group: group, build_timeout: 2000) } - set(:pipeline) do + let_it_be(:pipeline) do create(:ci_pipeline, project: project, sha: project.commit.id, ref: project.default_branch, diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 91185446488..8f2626037a1 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -3,11 +3,11 @@ require 'spec_helper' describe Ci::Build do - set(:user) { create(:user) } - set(:group) { create(:group) } - set(:project) { create(:project, :repository, group: group) } + let_it_be(:user) { create(:user) } + let_it_be(:group, reload: true) { create(:group) } + let_it_be(:project, reload: true) { create(:project, :repository, group: group) } - set(:pipeline) do + let_it_be(:pipeline, reload: true) do create(:ci_pipeline, project: project, sha: project.commit.id, ref: project.default_branch, @@ -3612,7 +3612,7 @@ describe Ci::Build do end describe '.matches_tag_ids' do - set(:build) { create(:ci_build, project: project, user: user) } + let_it_be(:build, reload: true) { create(:ci_build, project: project, user: user) } let(:tag_ids) { ::ActsAsTaggableOn::Tag.named_any(tag_list).ids } subject { described_class.where(id: build).matches_tag_ids(tag_ids) } @@ -3659,7 +3659,7 @@ describe Ci::Build do end describe '.matches_tags' do - set(:build) { create(:ci_build, project: project, user: user) } + let_it_be(:build, reload: true) { create(:ci_build, project: project, user: user) } subject { described_class.where(id: build).with_any_tags } @@ -3685,7 +3685,7 @@ describe Ci::Build do end describe 'pages deployments' do - set(:build) { create(:ci_build, project: project, user: user) } + let_it_be(:build, reload: true) { create(:ci_build, project: project, user: user) } context 'when job is "pages"' do before do @@ -3852,7 +3852,7 @@ describe Ci::Build do end describe '#artifacts_metadata_entry' do - set(:build) { create(:ci_build, project: project) } + let_it_be(:build) { create(:ci_build, project: project) } let(:path) { 'other_artifacts_0.1.2/another-subdirectory/banana_sample.gif' } around do |example| @@ -3952,7 +3952,7 @@ describe Ci::Build do end describe '#supported_runner?' do - set(:build) { create(:ci_build) } + let_it_be(:build) { create(:ci_build) } subject { build.supported_runner?(runner_features) } diff --git a/spec/models/ci/build_trace_chunk_spec.rb b/spec/models/ci/build_trace_chunk_spec.rb index ca49233dde1..f08f05a09bf 100644 --- a/spec/models/ci/build_trace_chunk_spec.rb +++ b/spec/models/ci/build_trace_chunk_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do include ExclusiveLeaseHelpers - set(:build) { create(:ci_build, :running) } + let_it_be(:build) { create(:ci_build, :running) } let(:chunk_index) { 0 } let(:data_store) { :redis } let(:raw_data) { nil } @@ -24,7 +24,7 @@ describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do context 'FastDestroyAll' do let(:parent) { create(:project) } let(:pipeline) { create(:ci_pipeline, project: parent) } - let(:build) { create(:ci_build, :running, :trace_live, pipeline: pipeline, project: parent) } + let!(:build) { create(:ci_build, :running, :trace_live, pipeline: pipeline, project: parent) } let(:subjects) { build.trace_chunks } describe 'Forbid #destroy and #destroy_all' do diff --git a/spec/models/ci/processable_spec.rb b/spec/models/ci/processable_spec.rb index 370606a73bc..f3d743fc272 100644 --- a/spec/models/ci/processable_spec.rb +++ b/spec/models/ci/processable_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe Ci::Processable do - set(:project) { create(:project) } - set(:pipeline) { create(:ci_pipeline, project: project) } + let_it_be(:project) { create(:project) } + let_it_be(:pipeline) { create(:ci_pipeline, project: project) } describe '#aggregated_needs_names' do let(:with_aggregated_needs) { pipeline.processables.select_with_aggregated_needs(project) } diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 3e494d19233..0192c8ed17d 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -38,8 +38,8 @@ describe Ci::Runner do end context 'runner_type validations' do - set(:group) { create(:group) } - set(:project) { create(:project) } + let_it_be(:group) { create(:group) } + let_it_be(:project) { create(:project) } let(:group_runner) { create(:ci_runner, :group, groups: [group]) } let(:project_runner) { create(:ci_runner, :project, projects: [project]) } let(:instance_runner) { create(:ci_runner, :instance) } @@ -322,7 +322,7 @@ describe Ci::Runner do end describe '#can_pick?' do - set(:pipeline) { create(:ci_pipeline) } + let_it_be(:pipeline) { create(:ci_pipeline) } let(:build) { create(:ci_build, pipeline: pipeline) } let(:runner_project) { build.project } let(:runner) { create(:ci_runner, :project, projects: [runner_project], tag_list: tag_list, run_untagged: run_untagged) } |