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
path: root/spec/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 14:18:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 14:18:50 +0300
commit8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch)
treea77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/db
parent00b35af3db1abfe813a778f643dad221aad51fca (diff)
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/db')
-rw-r--r--spec/db/development/import_common_metrics_spec.rb2
-rw-r--r--spec/db/production/import_common_metrics_spec.rb2
-rw-r--r--spec/db/production/settings_spec.rb2
-rw-r--r--spec/db/schema_spec.rb5
4 files changed, 6 insertions, 5 deletions
diff --git a/spec/db/development/import_common_metrics_spec.rb b/spec/db/development/import_common_metrics_spec.rb
index 25061ef0887..396eae9293e 100644
--- a/spec/db/development/import_common_metrics_spec.rb
+++ b/spec/db/development/import_common_metrics_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Import metrics on development seed' do
+RSpec.describe 'Import metrics on development seed' do
subject { load Rails.root.join('db', 'fixtures', 'development', '99_common_metrics.rb') }
it "imports all prometheus metrics" do
diff --git a/spec/db/production/import_common_metrics_spec.rb b/spec/db/production/import_common_metrics_spec.rb
index 1e4ff818a86..1cc0c2fd77f 100644
--- a/spec/db/production/import_common_metrics_spec.rb
+++ b/spec/db/production/import_common_metrics_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe 'Import metrics on production seed' do
+RSpec.describe 'Import metrics on production seed' do
subject { load Rails.root.join('db', 'fixtures', 'production', '999_common_metrics.rb') }
it "imports all prometheus metrics" do
diff --git a/spec/db/production/settings_spec.rb b/spec/db/production/settings_spec.rb
index 02e25aa37e3..84f7ae12728 100644
--- a/spec/db/production/settings_spec.rb
+++ b/spec/db/production/settings_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
require 'rainbow/ext/string'
-describe 'seed production settings' do
+RSpec.describe 'seed production settings' do
let(:settings_file) { Rails.root.join('db/fixtures/production/010_settings.rb') }
let(:settings) { Gitlab::CurrentSettings.current_application_settings }
diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb
index eac9eb7aa47..95d7981b85c 100644
--- a/spec/db/schema_spec.rb
+++ b/spec/db/schema_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('ee', 'spec', 'db', 'schema_support') if Gitlab.ee?
-describe 'Database schema' do
+RSpec.describe 'Database schema' do
prepend_if_ee('EE::DB::SchemaSupport')
let(:connection) { ActiveRecord::Base.connection }
@@ -92,7 +92,8 @@ describe 'Database schema' do
let(:indexes) { connection.indexes(table) }
let(:columns) { connection.columns(table) }
let(:foreign_keys) { connection.foreign_keys(table) }
- let(:primary_key_column) { connection.primary_key(table) }
+ # take the first column in case we're using a composite primary key
+ let(:primary_key_column) { Array(connection.primary_key(table)).first }
context 'all foreign keys' do
# for index to be effective, the FK constraint has to be at first place