diff options
| author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-03-11 14:22:49 +0100 |
|---|---|---|
| committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-03-11 14:22:49 +0100 |
| commit | 388f69b0de6450ec48a8b88df48bbe2d465593ea (patch) | |
| tree | 605a78c0546f20a86e63afe255a82c86f0148c7f /spec/lib/ci | |
| parent | 9a271d80128451eecc9a301d5e9924c09740be07 (diff) | |
| parent | 29ac9f64ea6d0a9e5a7615a9597c668dd129f5ae (diff) | |
| download | gitlab-ce-388f69b0de6450ec48a8b88df48bbe2d465593ea.tar.gz | |
Merge remote-tracking branch 'origin/master' into gitlab-ci-yaml-updates
# Conflicts:
# spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
Diffstat (limited to 'spec/lib/ci')
| -rw-r--r-- | spec/lib/ci/gitlab_ci_yaml_processor_spec.rb | 39 |
1 files changed, 39 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 fe5096989b2..fab6412d29f 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -495,6 +495,45 @@ module Ci end end + describe "YAML Alias/Anchor" do + it "is correctly supported for jobs" do + config = <<EOT +job1: &JOBTMPL + script: execute-script-for-job + +job2: *JOBTMPL +EOT + + config_processor = GitlabCiYamlProcessor.new(config) + + expect(config_processor.builds_for_stage_and_ref("test", "master").size).to eq(2) + expect(config_processor.builds_for_stage_and_ref("test", "master").first).to eq({ + except: nil, + stage: "test", + stage_idx: 1, + name: :job1, + only: nil, + commands: "\nexecute-script-for-job", + tag_list: [], + options: {}, + when: "on_success", + allow_failure: false + }) + expect(config_processor.builds_for_stage_and_ref("test", "master").second).to eq({ + except: nil, + stage: "test", + stage_idx: 1, + name: :job2, + only: nil, + commands: "\nexecute-script-for-job", + 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) |
