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
0472e26f
Commit
0472e26f
authored
Oct 30, 2020
by
Sofia Vistas
Committed by
Mark Lapierre
Oct 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Gradle coverage for deploying a Maven package
parent
3bb8e20d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
127 additions
and
0 deletions
+127
-0
qa/qa/specs/features/browser_ui/5_package/maven_gradle_repository_spec.rb
...ures/browser_ui/5_package/maven_gradle_repository_spec.rb
+127
-0
No files found.
qa/qa/specs/features/browser_ui/5_package/maven_gradle_repository_spec.rb
0 → 100644
View file @
0472e26f
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Package'
,
:orchestrated
,
:packages
do
describe
'Maven Repository with Gradle'
do
include
Runtime
::
Fixtures
let
(
:group_id
)
{
'com.gitlab.qa'
}
let
(
:artifact_id
)
{
'maven_gradle'
}
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
=
'maven-with-gradle-project'
project
.
initialize_with_readme
=
true
end
end
let!
(
:runner
)
do
Resource
::
Runner
.
fabricate!
do
|
runner
|
runner
.
name
=
"qa-runner-
#{
Time
.
now
.
to_i
}
"
runner
.
tags
=
[
"runner-for-
#{
project
.
name
}
"
]
runner
.
executor
=
:docker
runner
.
project
=
project
end
end
let
(
:gitlab_address_with_port
)
do
uri
=
URI
.
parse
(
Runtime
::
Scenario
.
gitlab_address
)
"
#{
uri
.
scheme
}
://
#{
uri
.
host
}
:
#{
uri
.
port
}
"
end
after
do
runner
.
remove_via_api!
end
it
'publishes a maven package via gradle'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1074'
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
([{
file_path:
'.gitlab-ci.yml'
,
content:
<<~
YAML
deploy:
image: gradle:6.5-jdk11
script:
- 'gradle publish'
only:
- master
tags:
- "runner-for-
#{
project
.
name
}
"
YAML
},
{
file_path:
'build.gradle'
,
content:
<<~
EOF
plugins {
id 'java'
id 'maven-publish'
}
publishing {
publications {
library(MavenPublication) {
groupId '
#{
group_id
}
'
artifactId '
#{
artifact_id
}
'
from components.java
}
}
repositories {
maven {
url "
#{
gitlab_address_with_port
}
/api/v4/projects/
#{
project
.
id
}
/packages/maven"
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value = "
#{
auth_token
}
"
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
EOF
}])
end
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:click_ci_cd_pipelines
)
Page
::
Project
::
Pipeline
::
Index
.
perform
(
&
:click_on_latest_pipeline
)
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
'deploy'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
800
)
end
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
|
show
.
click_delete
end
Page
::
Project
::
Packages
::
Index
.
perform
do
|
index
|
expect
(
index
).
to
have_content
(
"Package deleted successfully"
)
expect
(
index
).
to
have_no_package
(
package_name
)
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