diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/lib/gitlab/data_builder/pipeline_spec.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/lib/gitlab/data_builder/pipeline_spec.rb')
-rw-r--r-- | spec/lib/gitlab/data_builder/pipeline_spec.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/lib/gitlab/data_builder/pipeline_spec.rb b/spec/lib/gitlab/data_builder/pipeline_spec.rb index 297d87708d8..fd7cadeb89e 100644 --- a/spec/lib/gitlab/data_builder/pipeline_spec.rb +++ b/spec/lib/gitlab/data_builder/pipeline_spec.rb @@ -51,13 +51,15 @@ RSpec.describe Gitlab::DataBuilder::Pipeline do context 'build with runner' do let!(:build) { create(:ci_build, pipeline: pipeline, runner: ci_runner) } - let(:ci_runner) { create(:ci_runner) } + let!(:tag_names) { %w(tag-1 tag-2) } + let(:ci_runner) { create(:ci_runner, tag_list: tag_names.map { |n| ActsAsTaggableOn::Tag.create!(name: n)}) } it 'has runner attributes', :aggregate_failures do expect(runner_data[:id]).to eq(ci_runner.id) expect(runner_data[:description]).to eq(ci_runner.description) expect(runner_data[:active]).to eq(ci_runner.active) expect(runner_data[:is_shared]).to eq(ci_runner.instance_type?) + expect(runner_data[:tags]).to match_array(tag_names) end end @@ -102,5 +104,16 @@ RSpec.describe Gitlab::DataBuilder::Pipeline do expect(merge_request_attrs[:url]).to eq("http://localhost/#{merge_request.target_project.full_path}/-/merge_requests/#{merge_request.iid}") end end + + context 'when pipeline has retried builds' do + before do + create(:ci_build, :retried, pipeline: pipeline) + end + + it 'does not contain retried builds in payload' do + expect(data[:builds].count).to eq(1) + expect(build_data[:id]).to eq(build.id) + end + end end end |