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/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-14 12:07:53 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-14 12:07:53 +0300
commitc7ad2610df033b370845995ac3bbe269a191d9bb (patch)
treeeb82256802229e6ea2ee3648e04dd4b8125e3927 /qa
parent1c4773ed84d97c9577c0aa396a948b176a3c761b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb2
-rw-r--r--qa/qa/scenario/test/integration/gitaly_ha.rb13
-rw-r--r--qa/qa/service/praefect_manager.rb27
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/gitaly/high_availability_spec.rb63
-rw-r--r--qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb2
5 files changed, 106 insertions, 1 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index 9a7d2cb0f2a..6760ee8ec6f 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -143,6 +143,7 @@ module QA
autoload :Mattermost, 'qa/scenario/test/integration/mattermost'
autoload :ObjectStorage, 'qa/scenario/test/integration/object_storage'
autoload :SMTP, 'qa/scenario/test/integration/smtp'
+ autoload :GitalyHA, 'qa/scenario/test/integration/gitaly_ha'
end
module Sanity
@@ -449,6 +450,7 @@ module QA
autoload :Shellout, 'qa/service/shellout'
autoload :KubernetesCluster, 'qa/service/kubernetes_cluster'
autoload :Omnibus, 'qa/service/omnibus'
+ autoload :PraefectManager, 'qa/service/praefect_manager'
module ClusterProvider
autoload :Base, 'qa/service/cluster_provider/base'
diff --git a/qa/qa/scenario/test/integration/gitaly_ha.rb b/qa/qa/scenario/test/integration/gitaly_ha.rb
new file mode 100644
index 00000000000..dbca1a1dd6d
--- /dev/null
+++ b/qa/qa/scenario/test/integration/gitaly_ha.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module QA
+ module Scenario
+ module Test
+ module Integration
+ class GitalyHA < Test::Instance::All
+ tags :gitaly_ha
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/service/praefect_manager.rb b/qa/qa/service/praefect_manager.rb
new file mode 100644
index 00000000000..d8fa72456ad
--- /dev/null
+++ b/qa/qa/service/praefect_manager.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+module QA
+ module Service
+ class PraefectManager
+ include Service::Shellout
+
+ def initialize
+ @praefect = 'praefect'
+ @first_node = 'gitaly1'
+ @second_node = 'gitaly2'
+ @primary_node = @first_node
+ @secondary_node = @second_node
+ end
+
+ def stop_primary_node
+ shell "docker stop #{@primary_node}"
+ @secondary_node, @primary_node = @primary_node, @secondary_node
+ end
+
+ def reset
+ shell "docker start #{@primary_node}"
+ shell "docker start #{@secondary_node}"
+ end
+ end
+ end
+end
diff --git a/qa/qa/specs/features/browser_ui/3_create/gitaly/high_availability_spec.rb b/qa/qa/specs/features/browser_ui/3_create/gitaly/high_availability_spec.rb
new file mode 100644
index 00000000000..3bb03f68d51
--- /dev/null
+++ b/qa/qa/specs/features/browser_ui/3_create/gitaly/high_availability_spec.rb
@@ -0,0 +1,63 @@
+# frozen_string_literal: true
+
+module QA
+ context 'Create' do
+ context 'Gitaly' do
+ describe 'High Availability', :orchestrated, :gitaly_ha do
+ let(:project) do
+ Resource::Project.fabricate! do |project|
+ project.name = 'gitaly_high_availability'
+ end
+ end
+ let(:initial_file) { 'pushed_to_primary.txt' }
+ let(:final_file) { 'pushed_to_secondary.txt' }
+
+ before do
+ @praefect_manager = Service::PraefectManager.new
+ Flow::Login.sign_in
+ end
+
+ after do
+ @praefect_manager.reset
+ end
+
+ it 'makes sure that automatic failover is happening' do
+ Resource::Repository::ProjectPush.fabricate! do |push|
+ push.project = project
+ push.commit_message = 'pushed to primary gitaly node'
+ push.new_branch = true
+ push.file_name = initial_file
+ push.file_content = "This should exist on both nodes"
+ end
+
+ @praefect_manager.stop_primary_node
+
+ project.visit!
+
+ Page::Project::Show.perform do |show|
+ show.wait_until do
+ show.has_name?(project.name)
+ end
+ expect(show).to have_file(initial_file)
+ end
+
+ Resource::Repository::Commit.fabricate_via_api! do |commit|
+ commit.project = project
+ commit.add_files([
+ {
+ file_path: 'committed_to_primary.txt',
+ content: 'This should exist on both nodes too'
+ }
+ ])
+ end
+
+ project.visit!
+
+ Page::Project::Show.perform do |show|
+ expect(show).to have_file(final_file)
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb b/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb
index eda509641e3..45273655bb6 100644
--- a/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb
+++ b/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module QA
- context 'Monitor' do
+ context 'Monitor', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/217705', type: :flaky } do
describe 'with Prometheus Gitlab-managed cluster', :orchestrated, :kubernetes, :docker, :runner do
before :all do
Flow::Login.sign_in