diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-02-18 14:08:50 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-02-18 14:08:50 +0100 |
commit | bee26f9c4ef3c3cb1b1d3eb88500220823a7d7fb (patch) | |
tree | 35074bb2f908c09abe3b2097f5062f65c5b00214 | |
parent | 52d5eefd1fbb0af68c541b3d23397501f665dfa0 (diff) | |
download | gitlab-ce-bee26f9c4ef3c3cb1b1d3eb88500220823a7d7fb.tar.gz |
Add specs covering bug in build allowed to fail case
-rw-r--r-- | spec/models/ci/commit_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/models/ci/commit_spec.rb b/spec/models/ci/commit_spec.rb index dfc0cc3be1c..4dc309a4255 100644 --- a/spec/models/ci/commit_spec.rb +++ b/spec/models/ci/commit_spec.rb @@ -247,6 +247,35 @@ describe Ci::Commit, models: true do end end + + context 'custom stage with first job allowed to fail' do + let(:yaml) do + { + stages: ['clean', 'test'], + clean_job: { + stage: 'clean', + allow_failure: true, + script: 'BUILD', + }, + test_job: { + stage: 'test', + script: 'TEST', + }, + } + end + + before do + stub_ci_commit_yaml_file(YAML.dump(yaml)) + create_builds + end + + it 'properly schedules builds' do + expect(commit.builds.pluck(:status)).to contain_exactly('pending') + commit.builds.running_or_pending.each(&:drop) + expect(commit.builds.pluck(:status)).to contain_exactly('pending', 'failed') + end + end + context 'properly creates builds when "when" is defined' do let(:yaml) do { |