diff options
Diffstat (limited to 'spec/lib/gitlab/ci/status/composite_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/status/composite_spec.rb | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/spec/lib/gitlab/ci/status/composite_spec.rb b/spec/lib/gitlab/ci/status/composite_spec.rb index e1dcd05373f..bcfb9f19792 100644 --- a/spec/lib/gitlab/ci/status/composite_spec.rb +++ b/spec/lib/gitlab/ci/status/composite_spec.rb @@ -20,7 +20,7 @@ RSpec.describe Gitlab::Ci::Status::Composite do shared_examples 'compares status and warnings' do let(:composite_status) do - described_class.new(all_statuses) + described_class.new(all_statuses, dag: dag) end it 'returns status and warnings?' do @@ -30,21 +30,29 @@ RSpec.describe Gitlab::Ci::Status::Composite do end context 'allow_failure: false' do - where(:build_statuses, :result, :has_warnings) do - %i(skipped) | 'skipped' | false - %i(skipped success) | 'success' | false - %i(created) | 'created' | false - %i(preparing) | 'preparing' | false - %i(canceled success skipped) | 'canceled' | false - %i(pending created skipped) | 'pending' | false - %i(pending created skipped success) | 'running' | false - %i(running created skipped success) | 'running' | false - %i(success waiting_for_resource) | 'waiting_for_resource' | false - %i(success manual) | 'manual' | false - %i(success scheduled) | 'scheduled' | false - %i(created preparing) | 'preparing' | false - %i(created success pending) | 'running' | false - %i(skipped success failed) | 'failed' | false + where(:build_statuses, :dag, :result, :has_warnings) do + %i(skipped) | false | 'skipped' | false + %i(skipped success) | false | 'success' | false + %i(skipped success) | true | 'skipped' | false + %i(created) | false | 'created' | false + %i(preparing) | false | 'preparing' | false + %i(canceled success skipped) | false | 'canceled' | false + %i(canceled success skipped) | true | 'skipped' | false + %i(pending created skipped) | false | 'pending' | false + %i(pending created skipped success) | false | 'running' | false + %i(running created skipped success) | false | 'running' | false + %i(pending created skipped) | true | 'skipped' | false + %i(pending created skipped success) | true | 'skipped' | false + %i(running created skipped success) | true | 'skipped' | false + %i(success waiting_for_resource) | false | 'waiting_for_resource' | false + %i(success manual) | false | 'manual' | false + %i(success scheduled) | false | 'scheduled' | false + %i(created preparing) | false | 'preparing' | false + %i(created success pending) | false | 'running' | false + %i(skipped success failed) | false | 'failed' | false + %i(skipped success failed) | true | 'skipped' | false + %i(success manual) | true | 'pending' | false + %i(success failed created) | true | 'pending' | false end with_them do @@ -57,11 +65,12 @@ RSpec.describe Gitlab::Ci::Status::Composite do end context 'allow_failure: true' do - where(:build_statuses, :result, :has_warnings) do - %i(manual) | 'skipped' | false - %i(skipped failed) | 'success' | true - %i(created failed) | 'created' | true - %i(preparing manual) | 'preparing' | false + where(:build_statuses, :dag, :result, :has_warnings) do + %i(manual) | false | 'skipped' | false + %i(skipped failed) | false | 'success' | true + %i(skipped failed) | true | 'skipped' | true + %i(created failed) | false | 'created' | true + %i(preparing manual) | false | 'preparing' | false end with_them do |