Commit 59c9545f authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'jsl-fix-geo-ambiguous-match' into 'master'

Use full project name when searching dashboard in geo wiki specs

Closes #225202

See merge request gitlab-org/gitlab!37056
parents d7abfcb9 c5ba78d7
......@@ -5,21 +5,20 @@ module QA
describe 'GitLab wiki HTTP push' do
context 'wiki commit' do
it 'is replicated to the secondary node' do
wiki_title = 'Geo Replication Wiki'
wiki_content = 'This tests replication of wikis via HTTP'
push_content = 'This is from the Geo wiki push!'
project_name = "geo-wiki-project-#{SecureRandom.hex(8)}"
project = nil
# Create new wiki and push wiki commit
QA::Flow::Login.while_signed_in(address: :geo_primary) do
project = Resource::Project.fabricate_via_api! do |project|
project.name = project_name
project.name = 'geo-wiki-http-project'
project.description = 'Geo project for wiki repo test'
end
wiki = Resource::Wiki::ProjectPage.fabricate_via_api! do |wiki|
wiki.project = project
wiki.title = wiki_title
wiki.title = 'Geo Replication Wiki'
wiki.content = wiki_content
end
......@@ -50,8 +49,8 @@ module QA
end
Page::Dashboard::Projects.perform do |dashboard|
dashboard.wait_for_project_replication(project_name)
dashboard.go_to_project(project_name)
dashboard.wait_for_project_replication(project.name)
dashboard.go_to_project(project.name)
end
Page::Project::Menu.perform(&:click_wiki)
......
......@@ -5,18 +5,17 @@ module QA
RSpec.describe 'Geo', :orchestrated, :geo do
describe 'GitLab Geo Wiki HTTP push secondary' do
let(:wiki_content) { 'This tests wiki pushes via HTTP to secondary.' }
let(:push_content_primary) { 'This is from the Geo wiki push to primary!' }
let(:push_content_secondary) { 'This is from the Geo wiki push to secondary!' }
let(:project_name) { "geo-wiki-project-#{SecureRandom.hex(8)}" }
let(:git_push_http_path_prefix) { '/-/push_from_secondary' }
wiki = nil
project = nil
before do
QA::Flow::Login.while_signed_in(address: :geo_primary) do
# Create a new project and wiki
project = Resource::Project.fabricate_via_api! do |project|
project.name = project_name
project.name = 'geo-wiki-http2-project'
project.description = 'Geo test project'
end
......@@ -35,7 +34,7 @@ module QA
Resource::Repository::WikiPush.fabricate! do |push|
push.wiki = wiki
push.file_name = 'Readme.md'
push.file_content = push_content_primary
push.file_content = 'This is from the Geo wiki push to primary!'
push.commit_message = 'Update Readme.md'
end
end
......@@ -52,8 +51,8 @@ module QA
Page::Main::Menu.perform(&:go_to_projects)
Page::Dashboard::Projects.perform do |dashboard|
dashboard.wait_for_project_replication(project_name)
dashboard.go_to_project(project_name)
dashboard.wait_for_project_replication(project.name)
dashboard.go_to_project(project.name)
end
Page::Project::Menu.perform(&:click_wiki)
......
......@@ -5,30 +5,27 @@ module QA
describe 'GitLab wiki SSH push' do
context 'wiki commit' do
it 'is replicated to the secondary' do
wiki_title = 'Geo Replication Wiki'
wiki_content = 'This tests replication of wikis via SSH'
push_content = 'This is from the Geo wiki push via SSH!'
project_name = "geo-wiki-project-#{SecureRandom.hex(8)}"
key_title = "Geo wiki SSH #{Time.now.to_f}"
project = nil
key = nil
QA::Flow::Login.while_signed_in(address: :geo_primary) do
# Create a new SSH key
key = Resource::SSHKey.fabricate_via_api! do |resource|
resource.title = key_title
resource.title = "Geo wiki SSH #{Time.now.to_f}"
resource.expires_at = Date.today + 2
end
# Create a new project and wiki
project = Resource::Project.fabricate_via_api! do |project|
project.name = project_name
project.name = 'geo-wiki-ssh-project'
project.description = 'Geo project for wiki SSH spec'
end
wiki = Resource::Wiki::ProjectPage.fabricate_via_api! do |wiki|
wiki.project = project
wiki.title = wiki_title
wiki.title = 'Geo Replication Wiki'
wiki.content = wiki_content
end
......@@ -58,8 +55,8 @@ module QA
Page::Main::Menu.perform(&:go_to_projects)
Page::Dashboard::Projects.perform do |dashboard|
dashboard.wait_for_project_replication(project_name)
dashboard.go_to_project(project_name)
dashboard.wait_for_project_replication(project.name)
dashboard.go_to_project(project.name)
end
# Validate git push worked and new content is visible
......
......@@ -3,31 +3,29 @@
module QA
RSpec.describe 'Geo', :orchestrated, :geo do
describe 'GitLab wiki SSH push to secondary' do
wiki_title = 'Geo Replication Wiki'
wiki_content = 'This tests replication of wikis via SSH to secondary'
push_content = 'This is from the Geo wiki push via SSH to secondary!'
project_name = "geo-wiki-project-#{SecureRandom.hex(8)}"
key_title = "Geo wiki SSH to 2nd #{Time.now.to_f}"
wiki = nil
key = nil
project = nil
before do
QA::Flow::Login.while_signed_in(address: :geo_primary) do
# Create a new SSH key
key = Resource::SSHKey.fabricate_via_api! do |resource|
resource.title = key_title
resource.title = "Geo wiki SSH to 2nd #{Time.now.to_f}"
resource.expires_at = Date.today + 2
end
# Create a new project and wiki
project = Resource::Project.fabricate_via_api! do |project|
project.name = project_name
project.name = 'geo-wiki-ssh2-project'
project.description = 'Geo project for wiki SSH spec'
end
wiki = Resource::Wiki::ProjectPage.fabricate_via_api! do |wiki|
wiki.project = project
wiki.title = wiki_title
wiki.title = 'Geo Replication Wiki'
wiki.content = wiki_content
end
......@@ -50,8 +48,8 @@ module QA
Page::Main::Menu.perform(&:go_to_projects)
Page::Dashboard::Projects.perform do |dashboard|
dashboard.wait_for_project_replication(project_name)
dashboard.go_to_project(project_name)
dashboard.wait_for_project_replication(project.name)
dashboard.go_to_project(project.name)
end
Page::Project::Menu.perform(&:click_wiki)
......
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