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
let
(
:group_id
)
{
'com.gitlab.qa'
}
let
(
:artifact_id
)
{
"maven-
#{
SecureRandom
.
hex
(
8
)
}
"
}
let
(
:another_artifact_id
)
{
"maven-
#{
SecureRandom
.
hex
(
8
)
}
"
}
let
(
:package_name
)
{
"
#{
group_id
}
/
#{
artifact_id
}
"
.
tr
(
'.'
,
'/'
)
}
let
(
:auth_token
)
do
unless
Page
::
Main
::
Menu
.
perform
(
&
:signed_in?
)
...
...
@@ -64,7 +65,7 @@ module QA
<repositories>
<repository>
<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>
</repositories>
<distributionManagement>
...
...
@@ -82,6 +83,43 @@ module QA
}
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
{
file_path:
'settings.xml'
,
...
...
@@ -106,7 +144,7 @@ module QA
}
end
let
(
:gitlab_ci_
ya
ml
)
do
let
(
:gitlab_ci_
deploy_y
ml
)
do
{
file_path:
'.gitlab-ci.yml'
,
content:
...
...
@@ -124,58 +162,90 @@ module QA
}
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
runner
.
remove_via_api!
project
.
remove_via_api!
another_project
.
remove_via_api!
end
it
'publishes a maven package and deletes it'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/943'
do
# Use a maven docker container to deploy the package
with_fixtures
([
pom_xml
,
settings_xml
])
do
|
dir
|
Service
::
DockerRun
::
Maven
.
new
(
dir
).
publish!
it
'pushes and pulls a Maven package via CI and deletes it'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1115'
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
([
gitlab_ci_deploy_yml
,
settings_xml
,
pom_xml
])
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"
)
Flow
::
Pipeline
.
visit_latest_pipeline
show
.
click_delete
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
'deploy'
)
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
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
800
)
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
|
commit
.
project
=
project
commit
.
project
=
another_
project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
([
gitlab_ci_yaml
,
settings_xml
,
pom_xml
gitlab_ci_install_yml
,
pom_xml_another_project
])
end
project
.
visit!
another_
project
.
visit!
Flow
::
Pipeline
.
visit_latest_pipeline
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
'
deploy
'
)
pipeline
.
click_job
(
'
install
'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
800
)
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
context
'when "allow duplicate" setting is disabled'
do
...
...
@@ -204,7 +274,7 @@ module QA
commit
.
project
=
another_project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
([
gitlab_ci_
ya
ml
,
gitlab_ci_
deploy_y
ml
,
settings_xml
,
pom_xml
])
...
...
@@ -249,7 +319,7 @@ module QA
commit
.
project
=
another_project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
([
gitlab_ci_
ya
ml
,
gitlab_ci_
deploy_y
ml
,
settings_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