Commit f6093ed9 authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'nw-update-geo-push-tests' into 'master'

Update Geo tests to only assert controllable output text

See merge request gitlab-org/gitlab!70929
parents 00e3f6a4 9e14f736
...@@ -63,18 +63,11 @@ module QA ...@@ -63,18 +63,11 @@ module QA
end end
# We need to strip off the user from the URI, otherwise we won't # We need to strip off the user from the URI, otherwise we won't
# get the correct output produced from the git CLI. # get the correct output
primary_uri = project.repository_http_location.uri primary_uri = project.repository_http_location.uri
primary_uri.user = nil primary_uri.user = nil
# The secondary inserts a special path prefix. expect(push.output).to match(%r{This request to a Geo secondary node will be forwarded to the.*Geo primary node:.*#{primary_uri}}m)
# See `Gitlab::Geo::GitPushHttp::PATH_PREFIX`.
path = File.join(git_push_http_path_prefix, '\d+', primary_uri.path)
absolute_path = primary_uri.to_s.sub(primary_uri.path, path)
# The git cli produces the 'warning: redirecting to..' output
# internally.
expect(push.output).to match(/warning: redirecting to #{absolute_path}/)
# Validate git push worked and new content is visible # Validate git push worked and new content is visible
Page::Project::Show.perform do |show| Page::Project::Show.perform do |show|
...@@ -145,19 +138,11 @@ module QA ...@@ -145,19 +138,11 @@ module QA
end end
# We need to strip off the user from the URI, otherwise we won't # We need to strip off the user from the URI, otherwise we won't
# get the correct output produced from the git CLI. # get the correct output
primary_uri = project.repository_http_location.uri primary_uri = project.repository_http_location.uri
primary_uri.user = nil primary_uri.user = nil
# The secondary inserts a special path prefix. expect(push.output).to match(%r{This request to a Geo secondary node will be forwarded to the.*Geo primary node:.*#{primary_uri}}m)
# See `Gitlab::Geo::GitPushHttp::PATH_PREFIX`.
path = File.join(git_push_http_path_prefix, '\d+', primary_uri.path)
absolute_path = primary_uri.to_s.sub(primary_uri.path, path)
# The git cli produces the 'warning: redirecting to..' output
# internally.
expect(push.output).to match(/warning: redirecting to #{absolute_path}/)
expect(push.output).to match(/Locking support detected on remote "#{location.uri}"/)
# Validate git push worked and new content is visible # Validate git push worked and new content is visible
Page::Project::Show.perform do |show| Page::Project::Show.perform do |show|
......
...@@ -164,7 +164,6 @@ module QA ...@@ -164,7 +164,6 @@ module QA
ssh_uri = project.repository_ssh_location.git_uri.to_s.gsub(%r{ssh://}, '') ssh_uri = project.repository_ssh_location.git_uri.to_s.gsub(%r{ssh://}, '')
expect(push.output).to match(%r{This request to a Geo secondary node will be forwarded to the.*Geo primary node:.*#{ssh_uri}}m) expect(push.output).to match(%r{This request to a Geo secondary node will be forwarded to the.*Geo primary node:.*#{ssh_uri}}m)
expect(push.output).to match(/Locking support detected on remote "#{location.uri}"/)
# Validate git push worked and new content is visible # Validate git push worked and new content is visible
Page::Project::Show.perform do |show| Page::Project::Show.perform do |show|
......
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