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