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
7a2bc31e
Commit
7a2bc31e
authored
Aug 12, 2019
by
Mark Lapierre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport changes from EE
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8186
parent
da573ae2
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
153 additions
and
23 deletions
+153
-23
app/assets/javascripts/ide/components/error_message.vue
app/assets/javascripts/ide/components/error_message.vue
+1
-1
app/assets/javascripts/ide/components/panes/right.vue
app/assets/javascripts/ide/components/panes/right.vue
+2
-1
qa/qa.rb
qa/qa.rb
+5
-0
qa/qa/page/component/web_ide/alert.rb
qa/qa/page/component/web_ide/alert.rb
+27
-0
qa/qa/page/project/web_ide/edit.rb
qa/qa/page/project/web_ide/edit.rb
+3
-0
qa/qa/resource/project.rb
qa/qa/resource/project.rb
+1
-0
qa/qa/resource/repository/commit.rb
qa/qa/resource/repository/commit.rb
+66
-0
qa/qa/resource/runner.rb
qa/qa/resource/runner.rb
+20
-16
qa/qa/service/runner.rb
qa/qa/service/runner.rb
+25
-2
qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb
...atures/browser_ui/4_verify/runner/register_runner_spec.rb
+2
-2
qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb
...er_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb
+1
-1
No files found.
app/assets/javascripts/ide/components/error_message.vue
View file @
7a2bc31e
...
...
@@ -44,7 +44,7 @@ export default {
<
template
>
<div
class=
"flash-container flash-container-page"
@
click=
"clickFlash"
>
<div
class=
"flash-alert"
>
<div
class=
"flash-alert"
data-qa-selector=
"flash_alert"
>
<span
v-html=
"message.text"
>
</span>
<button
v-if=
"message.action"
...
...
app/assets/javascripts/ide/components/panes/right.vue
View file @
7a2bc31e
...
...
@@ -89,7 +89,7 @@ export default {
</
script
>
<
template
>
<div
class=
"multi-file-commit-panel ide-right-sidebar"
>
<div
class=
"multi-file-commit-panel ide-right-sidebar"
data-qa-selector=
"ide_right_sidebar"
>
<resizable-panel
v-show=
"isOpen"
:collapsible=
"false"
...
...
@@ -120,6 +120,7 @@ export default {
}"
data-container="body"
data-placement="left"
:data-qa-selector="`${tab.title.toLowerCase()}_tab_button`"
class="ide-sidebar-link is-right"
type="button"
@click="clickTab($event, tab)"
...
...
qa/qa.rb
View file @
7a2bc31e
...
...
@@ -73,6 +73,7 @@ module QA
end
module
Repository
autoload
:Commit
,
'qa/resource/repository/commit'
autoload
:Push
,
'qa/resource/repository/push'
autoload
:ProjectPush
,
'qa/resource/repository/project_push'
autoload
:WikiPush
,
'qa/resource/repository/wiki_push'
...
...
@@ -339,6 +340,10 @@ module QA
module
Issuable
autoload
:Common
,
'qa/page/component/issuable/common'
end
module
WebIDE
autoload
:Alert
,
'qa/page/component/web_ide/alert'
end
end
end
...
...
qa/qa/page/component/web_ide/alert.rb
0 → 100644
View file @
7a2bc31e
# frozen_string_literal: true
module
QA
module
Page
module
Component
module
WebIDE
module
Alert
def
self
.
prepended
(
page
)
page
.
module_eval
do
view
'app/assets/javascripts/ide/components/error_message.vue'
do
element
:flash_alert
end
end
end
def
has_no_alert?
(
message
=
nil
)
return
has_no_element?
(
:flash_alert
)
if
message
.
nil?
within_element
(
:flash_alert
)
do
has_no_text?
(
message
)
end
end
end
end
end
end
end
qa/qa/page/project/web_ide/edit.rb
View file @
7a2bc31e
...
...
@@ -5,6 +5,7 @@ module QA
module
Project
module
WebIDE
class
Edit
<
Page
::
Base
prepend
Page
::
Component
::
WebIDE
::
Alert
include
Page
::
Component
::
DropdownFilter
view
'app/assets/javascripts/ide/components/activity_bar.vue'
do
...
...
@@ -114,3 +115,5 @@ module QA
end
end
end
QA
::
Page
::
Project
::
WebIDE
::
Edit
.
prepend_if_ee
(
'QA::EE::Page::Component::WebIDE::WebTerminalPanel'
)
qa/qa/resource/project.rb
View file @
7a2bc31e
...
...
@@ -15,6 +15,7 @@ module QA
attribute
:add_name_uuid
attribute
:description
attribute
:standalone
attribute
:runners_token
attribute
:group
do
Group
.
fabricate!
...
...
qa/qa/resource/repository/commit.rb
0 → 100644
View file @
7a2bc31e
# frozen_string_literal: true
module
QA
module
Resource
module
Repository
class
Commit
<
Base
attr_accessor
:author_email
,
:author_name
,
:branch
,
:commit_message
,
:file_path
,
:sha
attribute
:project
do
Project
.
fabricate!
do
|
resource
|
resource
.
name
=
'project-with-commit'
end
end
def
initialize
@commit_message
=
'QA Test - Commit message'
end
def
files
=
(
files
)
if
!
files
.
is_a?
(
Array
)
||
files
.
empty?
||
files
.
any?
{
|
file
|
!
file
.
has_key?
(
:file_path
)
||
!
file
.
has_key?
(
:content
)
}
raise
ArgumentError
,
"Please provide an array of hashes e.g.: [{file_path: 'file1', content: 'foo'}]"
end
@files
=
files
end
def
resource_web_url
(
resource
)
super
rescue
ResourceURLMissingError
# this particular resource does not expose a web_url property
end
def
api_get_path
"
#{
api_post_path
}
/
#{
@sha
}
"
end
def
api_post_path
"/projects/
#{
CGI
.
escape
(
project
.
path_with_namespace
)
}
/repository/commits"
end
def
api_post_body
{
branch:
@branch
||
"master"
,
author_email:
@author_email
||
Runtime
::
User
.
default_email
,
author_name:
@author_name
||
Runtime
::
User
.
username
,
commit_message:
commit_message
,
actions:
actions
}
end
def
actions
@files
.
map
do
|
file
|
file
.
merge
({
action:
"create"
})
end
end
end
end
end
end
qa/qa/resource/runner.rb
View file @
7a2bc31e
...
...
@@ -6,9 +6,10 @@ module QA
module
Resource
class
Runner
<
Base
attr_writer
:name
,
:tags
,
:image
attr_accessor
:config
attribute
:project
do
Project
.
fabricate!
do
|
resource
|
Project
.
fabricate
_via_api
!
do
|
resource
|
resource
.
name
=
'project-with-ci-cd'
resource
.
description
=
'Project with CI/CD Pipelines'
end
...
...
@@ -26,23 +27,26 @@ module QA
@image
||
'gitlab/gitlab-runner:alpine'
end
def
fabricate!
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:go_to_ci_cd_settings
)
def
fabricate_via_api!
Service
::
Runner
.
new
(
name
).
tap
do
|
runner
|
Page
::
Project
::
Settings
::
CICD
.
perform
do
|
settings
|
settings
.
expand_runners_settings
do
|
runners
|
runner
.
pull
runner
.
token
=
runners
.
registration
_token
runner
.
address
=
runners
.
coordinator
_address
runner
.
token
=
project
.
runners
_token
runner
.
address
=
Runtime
::
Scenario
.
gitlab
_address
runner
.
tags
=
tags
runner
.
image
=
image
runner
.
config
=
config
if
config
runner
.
run_untagged
=
true
runner
.
register!
end
end
def
api_get_path
end
def
api_post_path
end
def
api_post_body
end
end
end
...
...
qa/qa/service/runner.rb
View file @
7a2bc31e
...
...
@@ -7,13 +7,25 @@ module QA
class
Runner
include
Service
::
Shellout
attr_accessor
:token
,
:address
,
:tags
,
:image
attr_accessor
:token
,
:address
,
:tags
,
:image
,
:run_untagged
attr_writer
:config
def
initialize
(
name
)
@image
=
'gitlab/gitlab-runner:alpine'
@name
=
name
||
"qa-runner-
#{
SecureRandom
.
hex
(
4
)
}
"
@network
=
Runtime
::
Scenario
.
attributes
[
:network
]
||
'test'
@tags
=
%w[qa test]
@run_untagged
=
false
end
def
config
@config
||=
<<~
END
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
END
end
def
network
...
...
@@ -32,19 +44,30 @@ module QA
shell
<<~
CMD
.
tr
(
"
\n
"
,
' '
)
docker run -d --rm --entrypoint=/bin/sh
--network
#{
network
}
--name
#{
@name
}
-p 8093:8093
-e CI_SERVER_URL=
#{
@address
}
-e REGISTER_NON_INTERACTIVE=true
-e REGISTRATION_TOKEN=
#{
@token
}
-e RUNNER_EXECUTOR=shell
-e RUNNER_TAG_LIST=
#{
@tags
.
join
(
','
)
}
-e RUNNER_NAME=
#{
@name
}
#{
@image
}
-c
'gitlab-runner register && gitlab-runner run'
#{
@image
}
-c
"
#{
register_command
}
"
CMD
end
def
remove!
shell
"docker rm -f
#{
@name
}
"
end
private
def
register_command
<<~
CMD
printf '
#{
config
.
chomp
.
gsub
(
/\n/
,
"
\\
n"
).
gsub
(
'"'
,
'\"'
)
}
' > /etc/gitlab-runner/config.toml &&
gitlab-runner register --run-untagged=
#{
@run_untagged
}
&&
gitlab-runner run
CMD
end
end
end
end
qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb
View file @
7a2bc31e
...
...
@@ -15,11 +15,11 @@ module QA
Resource
::
Runner
.
fabricate!
do
|
runner
|
runner
.
name
=
executor
end
end
.
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:go_to_ci_cd_settings
)
Page
::
Project
::
Settings
::
CICD
.
perform
do
|
settings
|
sleep
5
# Runner should register within 5 seconds
settings
.
refresh
settings
.
expand_runners_settings
do
|
page
|
expect
(
page
).
to
have_content
(
executor
)
...
...
qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb
View file @
7a2bc31e
...
...
@@ -17,7 +17,7 @@ module QA
@repository_location
=
@project
.
repository_ssh_location
Resource
::
Runner
.
fabricate_via_
browser_u
i!
do
|
resource
|
Resource
::
Runner
.
fabricate_via_
ap
i!
do
|
resource
|
resource
.
project
=
@project
resource
.
name
=
@runner_name
resource
.
tags
=
%w[qa docker]
...
...
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