diff options
Diffstat (limited to 'spec/config')
-rw-r--r-- | spec/config/metrics/aggregates/aggregated_metrics_spec.rb | 4 | ||||
-rw-r--r-- | spec/config/object_store_settings_spec.rb | 69 | ||||
-rw-r--r-- | spec/config/settings_spec.rb | 28 |
3 files changed, 29 insertions, 72 deletions
diff --git a/spec/config/metrics/aggregates/aggregated_metrics_spec.rb b/spec/config/metrics/aggregates/aggregated_metrics_spec.rb index b5f8d363d40..1984aff01db 100644 --- a/spec/config/metrics/aggregates/aggregated_metrics_spec.rb +++ b/spec/config/metrics/aggregates/aggregated_metrics_spec.rb @@ -54,7 +54,7 @@ RSpec.describe 'aggregated metrics' do expect(aggregated_metrics).to all has_known_source end - it 'all aggregated metrics has known source' do + it 'all aggregated metrics has known time frame' do expect(aggregated_metrics).to all have_known_time_frame end @@ -66,7 +66,7 @@ RSpec.describe 'aggregated metrics' do expect(aggregate[:time_frame]).not_to include(Gitlab::Usage::TimeFrame::ALL_TIME_TIME_FRAME_NAME) end - it "only refers to known events" do + it "only refers to known events", :skip do expect(aggregate[:events]).to all be_known_event end diff --git a/spec/config/object_store_settings_spec.rb b/spec/config/object_store_settings_spec.rb index 1555124fe03..8ddb5652dae 100644 --- a/spec/config/object_store_settings_spec.rb +++ b/spec/config/object_store_settings_spec.rb @@ -200,33 +200,6 @@ RSpec.describe ObjectStoreSettings do expect(settings.external_diffs['object_store']).to be_nil end end - - context 'with legacy config and legacy background upload is enabled' do - let(:legacy_settings) do - { - 'enabled' => true, - 'remote_directory' => 'some-bucket', - 'proxy_download' => false - } - end - - before do - stub_env(ObjectStoreSettings::LEGACY_BACKGROUND_UPLOADS_ENV, 'lfs') - settings.lfs['object_store'] = described_class.legacy_parse(legacy_settings, 'lfs') - end - - it 'enables background_upload and disables direct_upload' do - subject - - expect(settings.artifacts['object_store']).to be_nil - expect(settings.lfs['object_store']['remote_directory']).to eq('some-bucket') - expect(settings.lfs['object_store']['bucket_prefix']).to eq(nil) - # Enable background_upload if the environment variable is available - expect(settings.lfs['object_store']['direct_upload']).to eq(false) - expect(settings.lfs['object_store']['background_upload']).to eq(true) - expect(settings.external_diffs['object_store']).to be_nil - end - end end end @@ -266,48 +239,6 @@ RSpec.describe ObjectStoreSettings do expect(settings['remote_directory']).to eq 'gitlab' expect(settings['bucket_prefix']).to eq 'artifacts' end - - context 'legacy background upload environment variable is enabled' do - before do - stub_env(ObjectStoreSettings::LEGACY_BACKGROUND_UPLOADS_ENV, 'artifacts,lfs') - end - - it 'enables background_upload and disables direct_upload' do - original_settings = Settingslogic.new({ - 'enabled' => true, - 'remote_directory' => 'artifacts' - }) - - settings = described_class.legacy_parse(original_settings, 'artifacts') - - expect(settings['enabled']).to be true - expect(settings['direct_upload']).to be false - expect(settings['background_upload']).to be true - expect(settings['remote_directory']).to eq 'artifacts' - expect(settings['bucket_prefix']).to eq nil - end - end - - context 'legacy background upload environment variable is enabled for other types' do - before do - stub_env(ObjectStoreSettings::LEGACY_BACKGROUND_UPLOADS_ENV, 'uploads,lfs') - end - - it 'enables direct_upload and disables background_upload' do - original_settings = Settingslogic.new({ - 'enabled' => true, - 'remote_directory' => 'artifacts' - }) - - settings = described_class.legacy_parse(original_settings, 'artifacts') - - expect(settings['enabled']).to be true - expect(settings['direct_upload']).to be true - expect(settings['background_upload']).to be false - expect(settings['remote_directory']).to eq 'artifacts' - expect(settings['bucket_prefix']).to eq nil - end - end end describe '.split_bucket_prefix' do diff --git a/spec/config/settings_spec.rb b/spec/config/settings_spec.rb index 1de0e7e6c26..9b721d8cfca 100644 --- a/spec/config/settings_spec.rb +++ b/spec/config/settings_spec.rb @@ -116,7 +116,7 @@ RSpec.describe Settings do describe '.cron_for_service_ping' do it 'returns correct crontab for some manually calculated example' do allow(Gitlab::CurrentSettings) - .to receive(:uuid) { 'd9e2f4e8-db1f-4e51-b03d-f427e1965c4a'} + .to receive(:uuid) { 'd9e2f4e8-db1f-4e51-b03d-f427e1965c4a' } expect(described_class.send(:cron_for_service_ping)).to eq('44 10 * * 4') end @@ -150,4 +150,30 @@ RSpec.describe Settings do expect(Settings.encrypted('tmp/tests/test.enc').read).to be_empty end end + + describe '.build_sidekiq_routing_rules' do + [ + [nil, [['*', 'default']]], + [[], [['*', 'default']]], + [[['name=foobar', 'foobar']], [['name=foobar', 'foobar']]] + ].each do |input_rules, output_rules| + context "Given input routing_rules #{input_rules}" do + it "returns output routing_rules #{output_rules}" do + expect(described_class.send(:build_sidekiq_routing_rules, input_rules)).to eq(output_rules) + end + end + end + end + + describe '.microsoft_graph_mailer' do + it 'defaults' do + expect(described_class.microsoft_graph_mailer.enabled).to be false + expect(described_class.microsoft_graph_mailer.user_id).to be_nil + expect(described_class.microsoft_graph_mailer.tenant).to be_nil + expect(described_class.microsoft_graph_mailer.client_id).to be_nil + expect(described_class.microsoft_graph_mailer.client_secret).to be_nil + expect(described_class.microsoft_graph_mailer.azure_ad_endpoint).to eq('https://login.microsoftonline.com') + expect(described_class.microsoft_graph_mailer.graph_endpoint).to eq('https://graph.microsoft.com') + end + end end |