Commit 2f6f0d4d authored by Alex Ives's avatar Alex Ives

Remove stub_feature_flags for TF replication

- Remvoe calls to stub_feature_flags with
  geo_terraform_state_replication: false
- Automatically check for statuses from new classes
  that are added and enabled

Relates to https://gitlab.com/gitlab-org/gitlab/issues/233446
parent facdfab1
......@@ -13,24 +13,24 @@ RSpec.describe Gitlab::Geo::GeoNodeStatusCheck do
describe '#replication_verification_complete?' do
before do
allow(Gitlab.config.geo.registry_replication).to receive(:enabled).and_return(true)
stub_feature_flags(geo_terraform_state_replication: false)
end
it 'prints messages for all verification checks' do
[
/Repositories/,
/Verified Repositories/,
/Wikis/,
/Verified Wikis/,
/LFS Objects/,
/Attachments/,
/CI job artifacts/,
/Container repositories/,
/Design repositories/,
/Repositories Checked/,
/Package Files Checked/
].each do |text|
checks = [
/Repositories: /,
/Verified Repositories: /,
/Wikis: /,
/Verified Wikis: /,
/LFS Objects: /,
/Attachments: /,
/CI job artifacts: /,
/Container repositories: /,
/Design repositories: /,
/Repositories Checked: /
] + Gitlab::Geo.enabled_replicator_classes.map { |k| /#{k.replicable_title_plural} Checked:/ } +
Gitlab::Geo.enabled_replicator_classes.map { |k| /#{k.replicable_title_plural}:/ }
checks.each do |text|
expect { subject.print_replication_verification_status }.to output(text).to_stdout
end
end
......
......@@ -8,7 +8,6 @@ RSpec.describe 'geo rake tasks', :geo do
before do
Rake.application.rake_require 'tasks/geo'
stub_licensed_features(geo: true)
stub_feature_flags(geo_terraform_state_replication: false)
end
it 'Gitlab:Geo::DatabaseTasks responds to all methods used in Geo rake tasks' do
......@@ -345,27 +344,30 @@ RSpec.describe 'geo rake tasks', :geo do
end
it 'prints messages for all the checks' do
[
/Name/,
/URL/,
/GitLab Version/,
/Geo Role/,
/Health Status/,
/Sync Settings/,
/Database replication lag/,
/Repositories/,
/Verified Repositories/,
/Wikis/,
/Verified Wikis/,
/LFS Objects/,
/Attachments/,
/CI job artifacts/,
/Container repositories/,
/Design repositories/,
/Repositories Checked/,
/Last event ID seen from primary/,
/Last status report was/
].each do |text|
checks = [
/Name: /,
/URL: /,
/GitLab Version: /,
/Geo Role: /,
/Health Status: /,
/Sync Settings: /,
/Database replication lag: /,
/Repositories: /,
/Verified Repositories: /,
/Wikis: /,
/Verified Wikis: /,
/LFS Objects: /,
/Attachments: /,
/CI job artifacts: /,
/Container repositories: /,
/Design repositories: /,
/Repositories Checked: /,
/Last event ID seen from primary: /,
/Last status report was: /
] + Gitlab::Geo.enabled_replicator_classes.map { |k| /#{k.replicable_title_plural} Checked:/ } +
Gitlab::Geo.enabled_replicator_classes.map { |k| /#{k.replicable_title_plural}:/ }
checks.each do |text|
expect { run_rake_task('geo:status') }.to output(text).to_stdout
end
end
......
......@@ -8,7 +8,6 @@ RSpec.describe 'gitlab:geo rake tasks', :geo do
before do
Rake.application.rake_require 'tasks/gitlab/geo'
stub_licensed_features(geo: true)
stub_feature_flags(geo_terraform_state_replication: false)
end
describe 'gitlab:geo:check_replication_verification_status' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment