Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-11-13 15:10:07 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-11-13 15:10:07 +0300
commitdf592d51aeadc1b566abb600e283341876a8f064 (patch)
tree6b9acbcf1da5c40cceece035b0126a354f68650a /spec/tasks/gitlab
parent7ece9a7935fca35a8d91d2cb29bfad453b69be12 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tasks/gitlab')
-rw-r--r--spec/tasks/gitlab/click_house/migration_rake_spec.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/spec/tasks/gitlab/click_house/migration_rake_spec.rb b/spec/tasks/gitlab/click_house/migration_rake_spec.rb
index 6b834d52e9a..75a1c1a1856 100644
--- a/spec/tasks/gitlab/click_house/migration_rake_spec.rb
+++ b/spec/tasks/gitlab/click_house/migration_rake_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe 'gitlab:clickhouse', click_house: :without_migrations, feature_category: :database do
- include ClickHouseHelpers
+ include ClickHouseTestHelpers
# We don't need to delete data since we don't modify Postgres data
self.use_transactional_tests = false
@@ -11,13 +11,14 @@ RSpec.describe 'gitlab:clickhouse', click_house: :without_migrations, feature_ca
let(:migrations_base_dir) { 'click_house/migrations' }
let(:migrations_dirname) { '' }
let(:migrations_dir) { expand_fixture_path("#{migrations_base_dir}/#{migrations_dirname}") }
+ let(:verbose) { nil }
before(:all) do
Rake.application.rake_require 'tasks/gitlab/click_house/migration'
end
before do
- stub_env('VERBOSE', 'false')
+ stub_env('VERBOSE', verbose) if verbose
end
describe 'migrate' do
@@ -42,12 +43,26 @@ RSpec.describe 'gitlab:clickhouse', click_house: :without_migrations, feature_ca
it 'creates a table' do
expect { migration }.to change { active_schema_migrations_count }.from(0).to(1)
+ .and output.to_stdout
expect(describe_table('some')).to match({
id: a_hash_including(type: 'UInt64'),
date: a_hash_including(type: 'Date')
})
end
+
+ context 'when VERBOSE is false' do
+ let(:verbose) { 'false' }
+
+ it 'does not write to stdout' do
+ expect { migration }.not_to output.to_stdout
+
+ expect(describe_table('some')).to match({
+ id: a_hash_including(type: 'UInt64'),
+ date: a_hash_including(type: 'Date')
+ })
+ end
+ end
end
describe 'when dropping a table' do