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
204ae6dc
Commit
204ae6dc
authored
Aug 20, 2020
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds test cases controller and quality tab
Initial work for adding test cases.
parent
30ba441f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
136 additions
and
2 deletions
+136
-2
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+4
-2
ee/app/controllers/projects/quality/test_cases_controller.rb
ee/app/controllers/projects/quality/test_cases_controller.rb
+22
-0
ee/app/models/license.rb
ee/app/models/license.rb
+1
-0
ee/app/views/layouts/nav/_test_cases_link.html.haml
ee/app/views/layouts/nav/_test_cases_link.html.haml
+9
-0
ee/app/views/projects/quality/test_cases/index.html.haml
ee/app/views/projects/quality/test_cases/index.html.haml
+3
-0
ee/config/feature_flags/development/quality_test_cases.yml
ee/config/feature_flags/development/quality_test_cases.yml
+7
-0
ee/config/routes/project.rb
ee/config/routes/project.rb
+4
-0
ee/spec/controllers/projects/quality/test_cases_controller_spec.rb
...ontrollers/projects/quality/test_cases_controller_spec.rb
+83
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
app/views/layouts/nav/sidebar/_project.html.haml
View file @
204ae6dc
...
...
@@ -167,7 +167,7 @@
=
render_if_exists
"layouts/nav/requirements_link"
,
project:
@project
-
if
project_nav_tab?
:pipelines
=
nav_link
(
controller:
[
:pipelines
,
:builds
,
:jobs
,
:pipeline_schedules
,
:artifacts
],
unless:
->
{
current_path?
(
'projects/pipelines#charts'
)
})
do
=
nav_link
(
controller:
[
:pipelines
,
:builds
,
:jobs
,
:pipeline_schedules
,
:artifacts
,
:test_cases
],
unless:
->
{
current_path?
(
'projects/pipelines#charts'
)
})
do
=
link_to
project_pipelines_path
(
@project
),
class:
'shortcuts-pipelines qa-link-pipelines rspec-link-pipelines'
,
data:
{
qa_selector:
'ci_cd_link'
}
do
.nav-icon-container
=
sprite_icon
(
'rocket'
)
...
...
@@ -175,7 +175,7 @@
=
_
(
'CI / CD'
)
%ul
.sidebar-sub-level-items
=
nav_link
(
controller:
[
:pipelines
,
:builds
,
:jobs
,
:pipeline_schedules
,
:artifacts
],
html_options:
{
class:
"fly-out-top-item"
})
do
=
nav_link
(
controller:
[
:pipelines
,
:builds
,
:jobs
,
:pipeline_schedules
,
:artifacts
,
:test_cases
],
html_options:
{
class:
"fly-out-top-item"
})
do
=
link_to
project_pipelines_path
(
@project
)
do
%strong
.fly-out-top-item-name
=
_
(
'CI / CD'
)
...
...
@@ -204,6 +204,8 @@
%span
=
_
(
'Schedules'
)
=
render_if_exists
"layouts/nav/test_cases_link"
,
project:
@project
=
render_if_exists
'layouts/nav/sidebar/project_security_link'
# EE-specific
-
if
project_nav_tab?
:operations
...
...
ee/app/controllers/projects/quality/test_cases_controller.rb
0 → 100644
View file @
204ae6dc
# frozen_string_literal: true
class
Projects::Quality::TestCasesController
<
Projects
::
ApplicationController
before_action
:check_quality_management_available!
before_action
:authorize_read_issue!
before_action
:verify_test_cases_flag!
before_action
do
push_frontend_feature_flag
(
:quality_test_cases
,
project
)
end
def
index
respond_to
do
|
format
|
format
.
html
end
end
private
def
verify_test_cases_flag!
render_404
unless
Feature
.
enabled?
(
:quality_test_cases
,
project
)
end
end
ee/app/models/license.rb
View file @
204ae6dc
...
...
@@ -144,6 +144,7 @@ class License < ApplicationRecord
subepics
threat_monitoring
tracing
quality_management
]
EEU_FEATURES
.
freeze
...
...
ee/app/views/layouts/nav/_test_cases_link.html.haml
0 → 100644
View file @
204ae6dc
-
return
unless
Feature
.
enabled?
(
:quality_test_cases
,
project
)
-
return
unless
project
.
feature_available?
(
:quality_management
)
-
return
unless
can?
(
current_user
,
:read_issue
,
project
)
-
if
project_nav_tab?
(
:pipelines
)
=
nav_link
(
controller: :test_cases
)
do
=
link_to
project_quality_test_cases_path
(
project
),
title:
_
(
'Test Cases'
),
class:
'shortcuts-test-cases'
do
%span
=
_
(
'Test Cases'
)
ee/app/views/projects/quality/test_cases/index.html.haml
0 → 100644
View file @
204ae6dc
-
page_title
_
(
'Test Cases'
)
-
breadcrumb_title
_
(
"Test Cases"
)
ee/config/feature_flags/development/quality_test_cases.yml
0 → 100644
View file @
204ae6dc
---
name
:
quality_test_cases
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40019
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/241983
group
:
group::certify
type
:
development
default_enabled
:
false
\ No newline at end of file
ee/config/routes/project.rb
View file @
204ae6dc
...
...
@@ -15,6 +15,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resources
:requirements
,
only:
[
:index
]
end
namespace
:quality
do
resources
:test_cases
,
only:
[
:index
]
end
resources
:feature_flags
,
param: :iid
do
resources
:feature_flag_issues
,
only:
[
:index
,
:create
,
:destroy
],
as:
'issues'
,
path:
'issues'
end
...
...
ee/spec/controllers/projects/quality/test_cases_controller_spec.rb
0 → 100644
View file @
204ae6dc
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Projects
::
Quality
::
TestCasesController
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
subject
{
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
}
describe
'GET #index'
do
context
'with authorized user'
do
before
do
project
.
add_developer
(
user
)
sign_in
(
user
)
end
context
'when feature is available'
do
before
do
stub_licensed_features
(
quality_management:
true
)
end
it
'renders the index template'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
render_template
(
:index
)
end
context
'when quality_test_cases flag is disabled'
do
before
do
stub_feature_flags
(
quality_test_cases:
false
)
end
it
'returns 404'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
context
'when feature is not available'
do
before
do
stub_licensed_features
(
quality_management:
false
)
end
it
'returns 404'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
context
'with unauthorized user'
do
before
do
sign_in
(
user
)
end
context
'when feature is available'
do
before
do
stub_licensed_features
(
quality_management:
true
)
end
it
'returns 404'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
context
'with anonymous user'
do
it
'returns 302'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:found
)
expect
(
response
).
to
redirect_to
(
new_user_session_path
)
end
end
end
end
locale/gitlab.pot
View file @
204ae6dc
...
...
@@ -24200,6 +24200,9 @@ msgstr ""
msgid "Test"
msgstr ""
msgid "Test Cases"
msgstr ""
msgid "Test coverage parsing"
msgstr ""
...
...
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