diff options
Diffstat (limited to 'spec/lib/gitlab/ci/yaml_processor')
-rw-r--r-- | spec/lib/gitlab/ci/yaml_processor/dag_spec.rb | 1 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/yaml_processor/feature_flags_spec.rb | 30 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/yaml_processor/result_spec.rb | 4 |
3 files changed, 24 insertions, 11 deletions
diff --git a/spec/lib/gitlab/ci/yaml_processor/dag_spec.rb b/spec/lib/gitlab/ci/yaml_processor/dag_spec.rb index f815f56543c..082febacbd7 100644 --- a/spec/lib/gitlab/ci/yaml_processor/dag_spec.rb +++ b/spec/lib/gitlab/ci/yaml_processor/dag_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'fast_spec_helper' +require 'tsort' RSpec.describe Gitlab::Ci::YamlProcessor::Dag do let(:nodes) { {} } diff --git a/spec/lib/gitlab/ci/yaml_processor/feature_flags_spec.rb b/spec/lib/gitlab/ci/yaml_processor/feature_flags_spec.rb index 0bd9563d191..77346f328ca 100644 --- a/spec/lib/gitlab/ci/yaml_processor/feature_flags_spec.rb +++ b/spec/lib/gitlab/ci/yaml_processor/feature_flags_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'spec_helper' RSpec.describe Gitlab::Ci::YamlProcessor::FeatureFlags do let(:feature_flag) { :my_feature_flag } @@ -48,20 +48,32 @@ RSpec.describe Gitlab::Ci::YamlProcessor::FeatureFlags do end context 'when feature flag is checked outside the "with_actor" block' do - it 'raises an error on dev/test environment' do - expect { described_class.enabled?(feature_flag) }.to raise_error(described_class::NoActorError) - end + context 'when yaml_processor_feature_flag_corectness is used', :yaml_processor_feature_flag_corectness do + it 'raises an error on dev/test environment' do + expect { described_class.enabled?(feature_flag) }.to raise_error(described_class::NoActorError) + end + + context 'when on production' do + before do + allow(Gitlab::ErrorTracking).to receive(:should_raise_for_dev?).and_return(false) + end - context 'when on production' do - before do - allow(Gitlab::ErrorTracking).to receive(:should_raise_for_dev?).and_return(false) + it 'checks the feature flag without actor' do + expect(Feature).to receive(:enabled?).with(feature_flag, nil) + expect(Gitlab::ErrorTracking) + .to receive(:track_and_raise_for_dev_exception) + .and_call_original + + described_class.enabled?(feature_flag) + end end + end + context 'when yaml_processor_feature_flag_corectness is not used' do it 'checks the feature flag without actor' do expect(Feature).to receive(:enabled?).with(feature_flag, nil) expect(Gitlab::ErrorTracking) - .to receive(:track_and_raise_for_dev_exception) - .and_call_original + .to receive(:track_exception) described_class.enabled?(feature_flag) end diff --git a/spec/lib/gitlab/ci/yaml_processor/result_spec.rb b/spec/lib/gitlab/ci/yaml_processor/result_spec.rb index 8416501e949..f7a0905d9da 100644 --- a/spec/lib/gitlab/ci/yaml_processor/result_spec.rb +++ b/spec/lib/gitlab/ci/yaml_processor/result_spec.rb @@ -72,8 +72,8 @@ module Gitlab it 'returns calculated variables with root and job variables' do is_expected.to match_array([ - { key: 'VAR1', value: 'value 11', public: true }, - { key: 'VAR2', value: 'value 2', public: true } + { key: 'VAR1', value: 'value 11' }, + { key: 'VAR2', value: 'value 2' } ]) end |