Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ca302769
Commit
ca302769
authored
Sep 21, 2020
by
Jennifer Louie
Committed by
Sanad Liaquat
Sep 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for geo replication of Maven package files
parent
07e0b783
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
141 additions
and
0 deletions
+141
-0
qa/qa/ee.rb
qa/qa/ee.rb
+4
-0
qa/qa/ee/page/project/packages/index.rb
qa/qa/ee/page/project/packages/index.rb
+22
-0
qa/qa/ee/scenario/test/geo.rb
qa/qa/ee/scenario/test/geo.rb
+1
-0
qa/qa/page/project/packages/index.rb
qa/qa/page/project/packages/index.rb
+2
-0
qa/qa/specs/features/ee/browser_ui/geo/geo_replication_maven_package_spec.rb
...s/ee/browser_ui/geo/geo_replication_maven_package_spec.rb
+112
-0
No files found.
qa/qa/ee.rb
View file @
ca302769
...
...
@@ -166,6 +166,10 @@ module QA
module
PathLocks
autoload
:Index
,
'qa/ee/page/project/path_locks/index'
end
module
Packages
autoload
:Index
,
'qa/ee/page/project/packages/index'
end
end
module
MergeRequest
...
...
qa/qa/ee/page/project/packages/index.rb
0 → 100644
View file @
ca302769
# frozen_string_literal: true
module
QA
module
EE
module
Page
module
Project
module
Packages
module
Index
extend
QA
::
Page
::
PageConcern
def
wait_for_package_replication
(
name
)
QA
::
Runtime
::
Logger
.
debug
(
%Q[
#{
self
.
class
.
name
}
- wait_for_package_replication]
)
wait_until
(
max_duration:
Runtime
::
Geo
.
max_file_replication_time
)
do
has_package?
(
name
)
end
end
end
end
end
end
end
end
qa/qa/ee/scenario/test/geo.rb
View file @
ca302769
...
...
@@ -23,6 +23,7 @@ module QA
# Alias QA::Runtime::Scenario.gitlab_address to @address since
# some components depends on QA::Runtime::Scenario.gitlab_address.
QA
::
Runtime
::
Scenario
.
define
(
:gitlab_address
,
QA
::
Runtime
::
Scenario
.
geo_primary_address
)
QA
::
Runtime
::
Scenario
.
define
(
:network
,
'geo'
)
unless
options
[
:geo_skip_setup?
]
Geo
::
Primary
.
act
do
...
...
qa/qa/page/project/packages/index.rb
View file @
ca302769
...
...
@@ -26,3 +26,5 @@ module QA
end
end
end
QA
::
Page
::
Project
::
Packages
::
Index
.
prepend_if_ee
(
'QA::EE::Page::Project::Packages::Index'
)
qa/qa/specs/features/ee/browser_ui/geo/geo_replication_maven_package_spec.rb
0 → 100644
View file @
ca302769
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Geo'
,
:orchestrated
,
:geo
do
describe
'Maven package'
do
include
Runtime
::
Fixtures
let
(
:group_id
)
{
'com.gitlab.qa'
}
let
(
:artifact_id
)
{
'maven'
}
let
(
:package_name
)
{
"
#{
group_id
}
/
#{
artifact_id
}
"
.
tr
(
'.'
,
'/'
)
}
let
(
:auth_token
)
do
unless
Page
::
Main
::
Menu
.
perform
(
&
:signed_in?
)
Flow
::
Login
.
sign_in
end
Resource
::
PersonalAccessToken
.
fabricate!
.
access_token
end
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'geo-maven-package-project'
end
end
let
(
:uri
)
{
URI
.
parse
(
Runtime
::
Scenario
.
gitlab_address
)
}
let
(
:gitlab_address_with_port
)
{
"
#{
uri
.
scheme
}
://
#{
uri
.
host
}
:
#{
uri
.
port
}
"
}
it
'replicates to the secondary site'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1025'
do
pom_xml
=
{
file_path:
'pom.xml'
,
content:
<<~
XML
<project>
<groupId>
#{
group_id
}
</groupId>
<artifactId>
#{
artifact_id
}
</artifactId>
<version>1.0</version>
<modelVersion>4.0.0</modelVersion>
<repositories>
<repository>
<id>
#{
project
.
name
}
</id>
<url>
#{
gitlab_address_with_port
}
/api/v4/projects/
#{
project
.
id
}
/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>
#{
project
.
name
}
</id>
<url>
#{
gitlab_address_with_port
}
/api/v4/projects/
#{
project
.
id
}
/packages/maven</url>
</repository>
<snapshotRepository>
<id>
#{
project
.
name
}
</id>
<url>
#{
gitlab_address_with_port
}
/api/v4/projects/
#{
project
.
id
}
/packages/maven</url>
</snapshotRepository>
</distributionManagement>
</project>
XML
}
settings_xml
=
{
file_path:
'settings.xml'
,
content:
<<~
XML
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>
#{
project
.
name
}
</id>
<configuration>
<httpHeaders>
<property>
<name>Private-Token</name>
<value>
#{
auth_token
}
</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>
XML
}
# Use a Maven Docker container to deploy the package
with_fixtures
([
pom_xml
,
settings_xml
])
do
|
dir
|
Service
::
DockerRun
::
Maven
.
new
(
dir
).
publish!
end
QA
::
Runtime
::
Logger
.
debug
(
'Visiting the secondary Geo site'
)
QA
::
Flow
::
Login
.
while_signed_in
(
address: :geo_secondary
)
do
EE
::
Page
::
Main
::
Banner
.
perform
do
|
banner
|
expect
(
banner
).
to
have_secondary_read_only_banner
end
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
)
end
# Validate the content has been replicated
Page
::
Project
::
Menu
.
perform
(
&
:click_packages_link
)
Page
::
Project
::
Packages
::
Index
.
perform
do
|
index
|
index
.
wait_for_package_replication
(
package_name
)
index
.
click_package
(
package_name
)
end
Page
::
Project
::
Packages
::
Show
.
perform
do
|
show
|
expect
(
show
).
to
have_package_info
(
package_name
,
"1.0"
)
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment