Commit e8f51a55 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'ci/fix-defaut-tags' into 'master'

Fixes 'tags' support in 'default'

See merge request gitlab-org/gitlab!24741
parents e4606cc5 00bb9b60
......@@ -165,7 +165,7 @@ module Gitlab
helpers :before_script, :script, :stage, :type, :after_script,
:cache, :image, :services, :only, :except, :variables,
:artifacts, :environment, :coverage, :retry, :rules,
:parallel, :needs, :interruptible, :release
:parallel, :needs, :interruptible, :release, :tags
attributes :script, :tags, :allow_failure, :when, :dependencies,
:needs, :retry, :parallel, :extends, :start_in, :rules,
......@@ -242,6 +242,7 @@ module Gitlab
services: services_value,
stage: stage_value,
cache: cache_value,
tags: tags_value,
only: only_value,
except: except_value,
rules: has_rules? ? rules_value : nil,
......
......@@ -87,6 +87,28 @@ module Gitlab
end
end
describe 'tags entry with default values' do
it 'applies default values' do
config = YAML.dump({ default: { tags: %w[A B] },
rspec: { script: "rspec" } })
config_processor = Gitlab::Ci::YamlProcessor.new(config)
expect(config_processor.stage_builds_attributes("test").size).to eq(1)
expect(config_processor.stage_builds_attributes("test").first).to eq({
stage: "test",
stage_idx: 2,
name: "rspec",
only: { refs: %w[branches tags] },
options: { script: ["rspec"] },
tag_list: %w[A B],
allow_failure: false,
when: "on_success",
yaml_variables: []
})
end
end
describe 'interruptible entry' do
describe 'interruptible job' do
let(:config) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment