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
3498fc91
Commit
3498fc91
authored
Apr 23, 2021
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'maven-pull-test' into 'master'
Add install test for Maven See merge request gitlab-org/gitlab!59177
parents
dc5fd97b
36050607
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
30 deletions
+100
-30
qa/qa/specs/features/browser_ui/5_package/maven_repository_spec.rb
...cs/features/browser_ui/5_package/maven_repository_spec.rb
+100
-30
No files found.
qa/qa/specs/features/browser_ui/5_package/maven_repository_spec.rb
View file @
3498fc91
...
@@ -9,6 +9,7 @@ module QA
...
@@ -9,6 +9,7 @@ module QA
let
(
:group_id
)
{
'com.gitlab.qa'
}
let
(
:group_id
)
{
'com.gitlab.qa'
}
let
(
:artifact_id
)
{
"maven-
#{
SecureRandom
.
hex
(
8
)
}
"
}
let
(
:artifact_id
)
{
"maven-
#{
SecureRandom
.
hex
(
8
)
}
"
}
let
(
:another_artifact_id
)
{
"maven-
#{
SecureRandom
.
hex
(
8
)
}
"
}
let
(
:package_name
)
{
"
#{
group_id
}
/
#{
artifact_id
}
"
.
tr
(
'.'
,
'/'
)
}
let
(
:package_name
)
{
"
#{
group_id
}
/
#{
artifact_id
}
"
.
tr
(
'.'
,
'/'
)
}
let
(
:auth_token
)
do
let
(
:auth_token
)
do
unless
Page
::
Main
::
Menu
.
perform
(
&
:signed_in?
)
unless
Page
::
Main
::
Menu
.
perform
(
&
:signed_in?
)
...
@@ -64,7 +65,7 @@ module QA
...
@@ -64,7 +65,7 @@ module QA
<repositories>
<repositories>
<repository>
<repository>
<id>
#{
project
.
name
}
</id>
<id>
#{
project
.
name
}
</id>
<url>
#{
gitlab_address_with_port
}
/api/v4/
projects/
#{
project
.
id
}
/packages/maven</url>
<url>
#{
gitlab_address_with_port
}
/api/v4/
groups/
#{
project
.
group
.
id
}
/-
/packages/maven</url>
</repository>
</repository>
</repositories>
</repositories>
<distributionManagement>
<distributionManagement>
...
@@ -82,6 +83,43 @@ module QA
...
@@ -82,6 +83,43 @@ module QA
}
}
end
end
let
(
:pom_xml_another_project
)
do
{
file_path:
'pom.xml'
,
content:
<<~
XML
<project>
<groupId>
#{
group_id
}
</groupId>
<artifactId>
#{
another_artifact_id
}
</artifactId>
<version>1.0</version>
<modelVersion>4.0.0</modelVersion>
<repositories>
<repository>
<id>
#{
another_project
.
name
}
</id>
<url>
#{
gitlab_address_with_port
}
/api/v4/groups/
#{
another_project
.
group
.
id
}
/-/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>
#{
another_project
.
name
}
</id>
<url>
#{
gitlab_address_with_port
}
/api/v4/projects/
#{
another_project
.
id
}
/packages/maven</url>
</repository>
<snapshotRepository>
<id>
#{
another_project
.
name
}
</id>
<url>
#{
gitlab_address_with_port
}
/api/v4/projects/
#{
another_project
.
id
}
/packages/maven</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>
#{
group_id
}
</groupId>
<artifactId>
#{
artifact_id
}
</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</project>
XML
}
end
let
(
:settings_xml
)
do
let
(
:settings_xml
)
do
{
{
file_path:
'settings.xml'
,
file_path:
'settings.xml'
,
...
@@ -106,7 +144,7 @@ module QA
...
@@ -106,7 +144,7 @@ module QA
}
}
end
end
let
(
:gitlab_ci_
ya
ml
)
do
let
(
:gitlab_ci_
deploy_y
ml
)
do
{
{
file_path:
'.gitlab-ci.yml'
,
file_path:
'.gitlab-ci.yml'
,
content:
content:
...
@@ -124,58 +162,90 @@ module QA
...
@@ -124,58 +162,90 @@ module QA
}
}
end
end
let
(
:gitlab_ci_install_yml
)
do
{
file_path:
'.gitlab-ci.yml'
,
content:
<<~
YAML
install:
image: maven:3.6-jdk-11
script:
- "mvn install"
only:
- "
#{
project
.
default_branch
}
"
tags:
- "runner-for-
#{
another_project
.
group
.
name
}
"
YAML
}
end
after
do
after
do
runner
.
remove_via_api!
runner
.
remove_via_api!
project
.
remove_via_api!
another_project
.
remove_via_api!
end
end
it
'publishes a maven package and deletes it'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/943'
do
it
'pushes and pulls a Maven package via CI and deletes it'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1115'
do
# Use a maven docker container to deploy the package
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
with_fixtures
([
pom_xml
,
settings_xml
])
do
|
dir
|
commit
.
project
=
project
Service
::
DockerRun
::
Maven
.
new
(
dir
).
publish!
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
([
gitlab_ci_deploy_yml
,
settings_xml
,
pom_xml
])
end
end
project
.
visit!
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:click_packages_link
)
Flow
::
Pipeline
.
visit_latest_pipeline
Page
::
Project
::
Packages
::
Index
.
perform
do
|
index
|
expect
(
index
).
to
have_package
(
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"
)
show
.
click_delete
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
'deploy'
)
end
end
Page
::
Project
::
Packages
::
Index
.
perform
do
|
index
|
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
index
).
to
have_content
(
"Package deleted successfully"
)
expect
(
job
).
to
be_successful
(
timeout:
800
)
expect
(
index
).
not_to
have_package
(
package_name
)
end
end
end
it
'publishes and downloads a maven package via CI'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1115'
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
project
=
another_
project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
([
commit
.
add_files
([
gitlab_ci_yaml
,
gitlab_ci_install_yml
,
settings_xml
,
pom_xml_another_project
pom_xml
])
])
end
end
project
.
visit!
another_
project
.
visit!
Flow
::
Pipeline
.
visit_latest_pipeline
Flow
::
Pipeline
.
visit_latest_pipeline
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
'
deploy
'
)
pipeline
.
click_job
(
'
install
'
)
end
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
800
)
expect
(
job
).
to
be_successful
(
timeout:
800
)
end
end
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:click_packages_link
)
Page
::
Project
::
Packages
::
Index
.
perform
do
|
index
|
expect
(
index
).
to
have_package
(
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"
)
show
.
click_delete
end
Page
::
Project
::
Packages
::
Index
.
perform
do
|
index
|
expect
(
index
).
to
have_content
(
"Package deleted successfully"
)
expect
(
index
).
not_to
have_package
(
package_name
)
end
end
end
context
'when "allow duplicate" setting is disabled'
do
context
'when "allow duplicate" setting is disabled'
do
...
@@ -204,7 +274,7 @@ module QA
...
@@ -204,7 +274,7 @@ module QA
commit
.
project
=
another_project
commit
.
project
=
another_project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
([
commit
.
add_files
([
gitlab_ci_
ya
ml
,
gitlab_ci_
deploy_y
ml
,
settings_xml
,
settings_xml
,
pom_xml
pom_xml
])
])
...
@@ -249,7 +319,7 @@ module QA
...
@@ -249,7 +319,7 @@ module QA
commit
.
project
=
another_project
commit
.
project
=
another_project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
([
commit
.
add_files
([
gitlab_ci_
ya
ml
,
gitlab_ci_
deploy_y
ml
,
settings_xml
,
settings_xml
,
pom_xml
pom_xml
])
])
...
...
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