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
ca1dfc6f
Commit
ca1dfc6f
authored
Feb 28, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
37a02a6b
f6453eca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
129 deletions
+114
-129
qa/qa/service/kubernetes_cluster.rb
qa/qa/service/kubernetes_cluster.rb
+1
-1
qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb
...igure/auto_devops/create_project_with_auto_devops_spec.rb
+113
-128
No files found.
qa/qa/service/kubernetes_cluster.rb
View file @
ca1dfc6f
...
...
@@ -9,7 +9,7 @@ module QA
attr_reader
:api_url
,
:ca_certificate
,
:token
,
:rbac
def
initialize
(
rbac:
fals
e
)
def
initialize
(
rbac:
tru
e
)
@rbac
=
rbac
end
...
...
qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb
View file @
ca1dfc6f
...
...
@@ -11,163 +11,148 @@ module QA
end
describe
'Auto DevOps support'
,
:orchestrated
,
:kubernetes
,
:quarantine
do
[
true
,
false
].
each
do
|
rbac
|
context
"when rbac is
#{
rbac
?
'enabled'
:
'disabled'
}
"
do
before
(
:all
)
do
login
@project
=
Resource
::
Project
.
fabricate!
do
|
p
|
p
.
name
=
Runtime
::
Env
.
auto_devops_project_name
||
'project-with-autodevops'
p
.
description
=
'Project with Auto DevOps'
end
# Disable code_quality check in Auto DevOps pipeline as it takes
# too long and times out the test
Resource
::
CiVariable
.
fabricate!
do
|
resource
|
resource
.
project
=
@project
resource
.
key
=
'CODE_QUALITY_DISABLED'
resource
.
value
=
'1'
end
context
'when rbac is enabled'
do
before
(
:all
)
do
login
# Create Auto DevOps compatible repo
Resource
::
Repository
::
ProjectPush
.
fabricate!
do
|
push
|
push
.
project
=
@project
push
.
directory
=
Pathname
.
new
(
__dir__
)
.
join
(
'../../../../../fixtures/auto_devops_rack'
)
push
.
commit_message
=
'Create Auto DevOps compatible rack application'
end
# Create and connect K8s cluster
@cluster
=
Service
::
KubernetesCluster
.
new
(
rbac:
rbac
).
create!
Resource
::
KubernetesCluster
.
fabricate!
do
|
cluster
|
cluster
.
project
=
@project
cluster
.
cluster
=
@cluster
cluster
.
install_helm_tiller
=
true
cluster
.
install_ingress
=
true
cluster
.
install_prometheus
=
true
cluster
.
install_runner
=
true
end
@project
=
Resource
::
Project
.
fabricate!
do
|
p
|
p
.
name
=
Runtime
::
Env
.
auto_devops_project_name
||
'project-with-autodevops'
p
.
description
=
'Project with Auto DevOps'
end
@project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:click_ci_cd_settings
)
Page
::
Project
::
Settings
::
CICD
.
perform
do
|
p
|
p
.
enable_auto_devops
end
# Disable code_quality check in Auto DevOps pipeline as it takes
# too long and times out the test
Resource
::
CiVariable
.
fabricate!
do
|
resource
|
resource
.
project
=
@project
resource
.
key
=
'CODE_QUALITY_DISABLED'
resource
.
value
=
'1'
end
after
(
:all
)
do
@cluster
&
.
remove!
# Create Auto DevOps compatible repo
Resource
::
Repository
::
ProjectPush
.
fabricate!
do
|
push
|
push
.
project
=
@project
push
.
directory
=
Pathname
.
new
(
__dir__
)
.
join
(
'../../../../../fixtures/auto_devops_rack'
)
push
.
commit_message
=
'Create Auto DevOps compatible rack application'
end
before
do
login
# Create and connect K8s cluster
@cluster
=
Service
::
KubernetesCluster
.
new
.
create!
Resource
::
KubernetesCluster
.
fabricate!
do
|
cluster
|
cluster
.
project
=
@project
cluster
.
cluster
=
@cluster
cluster
.
install_helm_tiller
=
true
cluster
.
install_ingress
=
true
cluster
.
install_prometheus
=
true
cluster
.
install_runner
=
true
end
end
it
'runs auto devops'
do
@project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:click_ci_cd_pipelines
)
Page
::
Project
::
Pipeline
::
Index
.
perform
(
&
:go_to_latest_pipeline
)
after
(
:all
)
do
@cluster
&
.
remove!
end
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
go_to_job
(
'build'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
600
)
it
'runs auto devops'
do
@project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:click_ci_cd_pipelines
)
Page
::
Project
::
Pipeline
::
Index
.
perform
(
&
:go_to_latest_pipeline
)
job
.
click_element
(
:pipeline_path
)
end
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
go_to_job
(
'build'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
600
)
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
go_to_job
(
'test'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
600
)
job
.
click_element
(
:pipeline_path
)
end
job
.
click_element
(
:pipeline_path
)
end
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
go_to_job
(
'test'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
600
)
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
go_to_job
(
'production'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
1200
)
job
.
click_element
(
:pipeline_path
)
end
job
.
click_element
(
:pipeline_path
)
end
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
go_to_job
(
'production'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
1200
)
Page
::
Project
::
Menu
.
perform
(
&
:click_operations_environments
)
Page
::
Project
::
Operations
::
Environments
::
Index
.
perform
do
|
index
|
index
.
go_to_environment
(
'production'
)
end
Page
::
Project
::
Operations
::
Environments
::
Show
.
perform
do
|
show
|
show
.
view_deployment
do
expect
(
page
).
to
have_content
(
'Hello World!'
)
end
end
job
.
click_element
(
:pipeline_path
)
end
it
'user sets application secret variable and Auto DevOps passes it to container'
do
# Set an application secret CI variable (prefixed with K8S_SECRET_)
Resource
::
CiVariable
.
fabricate!
do
|
resource
|
resource
.
project
=
@project
resource
.
key
=
'K8S_SECRET_OPTIONAL_MESSAGE'
resource
.
value
=
'You can see this application secret'
Page
::
Project
::
Menu
.
perform
(
&
:click_operations_environments
)
Page
::
Project
::
Operations
::
Environments
::
Index
.
perform
do
|
index
|
index
.
go_to_environment
(
'production'
)
end
Page
::
Project
::
Operations
::
Environments
::
Show
.
perform
do
|
show
|
show
.
view_deployment
do
expect
(
page
).
to
have_content
(
'Hello World!'
)
end
end
end
# Our current Auto DevOps implementation won't update the production
# app if we only update a CI variable with no code change.
#
# Workaround: push new code and use the resultant pipeline.
Resource
::
Repository
::
ProjectPush
.
fabricate!
do
|
push
|
push
.
project
=
@project
push
.
commit_message
=
'Force a Deployment change by pushing new code'
push
.
file_name
=
'new_file.txt'
push
.
file_content
=
'new file contents'
end
it
'user sets application secret variable and Auto DevOps passes it to container'
do
# Set an application secret CI variable (prefixed with K8S_SECRET_)
Resource
::
CiVariable
.
fabricate!
do
|
resource
|
resource
.
project
=
@project
resource
.
key
=
'K8S_SECRET_OPTIONAL_MESSAGE'
resource
.
value
=
'You can see this application secret'
end
@project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:click_ci_cd_pipelines
)
Page
::
Project
::
Pipeline
::
Index
.
perform
(
&
:go_to_latest_pipeline
)
# Our current Auto DevOps implementation won't update the production
# app if we only update a CI variable with no code change.
#
# Workaround: push new code and use the resultant pipeline.
Resource
::
Repository
::
ProjectPush
.
fabricate!
do
|
push
|
push
.
project
=
@project
push
.
commit_message
=
'Force a Deployment change by pushing new code'
push
.
file_name
=
'new_file.txt'
push
.
file_content
=
'new file contents'
end
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
go_to_job
(
'build'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
600
)
Page
::
Project
::
Menu
.
perform
(
&
:click_ci_cd_pipelines
)
Page
::
Project
::
Pipeline
::
Index
.
perform
(
&
:go_to_latest_pipeline
)
job
.
click_element
(
:pipeline_path
)
end
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
go_to_job
(
'build'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
600
)
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
go_to_job
(
'test'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
600
)
job
.
click_element
(
:pipeline_path
)
end
job
.
click_element
(
:pipeline_path
)
end
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
go_to_job
(
'test'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
600
)
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
go_to_job
(
'production'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
1200
)
job
.
click_element
(
:pipeline_path
)
end
job
.
click_element
(
:pipeline_path
)
end
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
go_to_job
(
'production'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
1200
)
end
Page
::
Project
::
Menu
.
perform
(
&
:click_operations_environments
)
Page
::
Project
::
Menu
.
perform
(
&
:click_operations_environments
)
Page
::
Project
::
Operations
::
Environments
::
Index
.
perform
do
|
index
|
index
.
go_to_environment
(
'production'
)
end
Page
::
Project
::
Operations
::
Environments
::
Index
.
perform
do
|
index
|
index
.
go_to_environment
(
'production'
)
end
Page
::
Project
::
Operations
::
Environments
::
Show
.
perform
do
|
show
|
show
.
view_deployment
do
expect
(
page
).
to
have_content
(
'Hello World!'
)
expect
(
page
).
to
have_content
(
'You can see this application secret'
)
end
Page
::
Project
::
Operations
::
Environments
::
Show
.
perform
do
|
show
|
show
.
view_deployment
do
expect
(
page
).
to
have_content
(
'Hello World!'
)
expect
(
page
).
to
have_content
(
'You can see this application secret'
)
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