summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-03-11 13:39:11 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-03-11 13:41:05 +0100
commitad4d3a075fc338280baaf6240861c9de7aa312ad (patch)
tree14c99f23fa5a85686f3b5be1b5160a5ff45ce657 /spec
parent0c5b92cbd7afe7483470c7d33a0b8475ba91d390 (diff)
downloadgitlab-ce-ad4d3a075fc338280baaf6240861c9de7aa312ad.tar.gz
Describe special YAML features: the use of anchors and hidden jobs
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/ci/gitlab_ci_yaml_processor_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
index f3394910c5b..665a65fe352 100644
--- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
@@ -427,6 +427,35 @@ module Ci
end
end
+ describe "Hidden jobs" do
+ let(:config) do
+ YAML.dump({
+ '.hidden_job' => { script: 'test' },
+ 'normal_job' => { script: 'test' }
+ })
+ end
+
+ let(:config_processor) { GitlabCiYamlProcessor.new(config) }
+
+ subject { config_processor.builds_for_stage_and_ref("test", "master") }
+
+ it "doesn't create jobs that starts with dot" do
+ expect(subject.size).to eq(1)
+ expect(subject.first).to eq({
+ except: nil,
+ stage: "test",
+ stage_idx: 1,
+ name: :normal_job,
+ only: nil,
+ commands: "\ntest",
+ tag_list: [],
+ options: {},
+ when: "on_success",
+ allow_failure: false
+ })
+ end
+ end
+
describe "Error handling" do
it "fails to parse YAML" do
expect{GitlabCiYamlProcessor.new("invalid: yaml: test")}.to raise_error(Psych::SyntaxError)