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
9ac23fee
Commit
9ac23fee
authored
Dec 14, 2020
by
Felipe Artur
Committed by
Thong Kuah
Dec 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove test cases feature flag
Remove test cases feature flag from codebase
parent
ae1f26ee
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
36 additions
and
76 deletions
+36
-76
doc/ci/test_cases/index.md
doc/ci/test_cases/index.md
+25
-25
doc/user/permissions.md
doc/user/permissions.md
+5
-1
ee/app/controllers/projects/quality/test_cases_controller.rb
ee/app/controllers/projects/quality/test_cases_controller.rb
+0
-9
ee/app/services/quality_management/test_cases/create_service.rb
.../services/quality_management/test_cases/create_service.rb
+1
-1
ee/app/views/layouts/nav/_test_cases_link.html.haml
ee/app/views/layouts/nav/_test_cases_link.html.haml
+0
-1
ee/changelogs/unreleased/remove_quality_test_cases_flag.yml
ee/changelogs/unreleased/remove_quality_test_cases_flag.yml
+5
-0
ee/config/feature_flags/development/quality_test_cases.yml
ee/config/feature_flags/development/quality_test_cases.yml
+0
-8
ee/spec/controllers/projects/quality/test_cases_controller_spec.rb
...ontrollers/projects/quality/test_cases_controller_spec.rb
+0
-12
ee/spec/requests/api/graphql/mutations/quality_management/test_cases/create_spec.rb
...ql/mutations/quality_management/test_cases/create_spec.rb
+0
-8
ee/spec/services/quality_management/test_cases/create_service_spec.rb
...ices/quality_management/test_cases/create_service_spec.rb
+0
-11
No files found.
doc/ci/test_cases/index.md
View file @
9ac23fee
...
...
@@ -8,12 +8,8 @@ type: reference
# Test Cases **(ULTIMATE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233479) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.6.
> - It's [deployed behind a feature flag](../../user/feature_flags.md), enabled by default.
> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/241983) on GitLab 13.6.
> - It's enabled on GitLab.com.
> - It's recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-test-cases). **(ULTIMATE ONLY)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233479) in GitLab 13.6.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/241983) in GitLab 13.7.
Test cases in GitLab can help your teams create testing scenarios in their existing development platform.
...
...
@@ -22,6 +18,8 @@ use external test planning tools, which require additional overhead, context swi
## Create a test case
Users with Reporter or higher
[
permissions
](
../../user/permissions.md
)
can create test cases.
To create a test case in a GitLab project:
1.
Navigate to
**CI/CD > Test Cases**
.
...
...
@@ -34,6 +32,8 @@ To create a test case in a GitLab project:
You can view all test cases in the project in the Test Cases list. Filter the
issue list with a search query, including labels or the test case's title.
Users with Guest or higher
[
permissions
](
../../user/permissions.md
)
can view test cases.
![
Test case list page
](
img/test_case_list_v13_6.png
)
To view a test case:
...
...
@@ -43,10 +43,27 @@ To view a test case:
![
An example test case page
](
img/test_case_show_v13_6.png
)
## Edit a test case
You can edit a test case's title and description.
Users with Reporter or higher
[
permissions
](
../../user/permissions.md
)
can edit test cases.
Users demoted to the Guest role can continue to edit the test cases they created
when they were in the higher role.
To edit a test case:
1.
[
View a test case
](
#view-a-test-case
)
.
1.
Select
**Edit title and description**
(
**{pencil}**
).
1.
Edit the test case's title or description.
1.
Select
**Save changes**
.
## Archive a test case
When you want to stop using a test case, you can archive it. You can
[
reopen an archived test case
](
#reopen-an-archived-test-case
)
later.
Users with Reporter or higher
[
permissions
](
../../user/permissions.md
)
can archive test cases.
To archive a test case, on the test case's page, select the
**Archive test case**
button.
To view archived test cases:
...
...
@@ -58,23 +75,6 @@ To view archived test cases:
If you decide to start using an archived test case again, you can reopen it.
To reopen an archived test case, on the test case's page, select the
**Reopen test case**
button.
### Enable or disable Test Cases **(ULTIMATE ONLY)**
The GitLab Test Cases feature is under development but ready for production use.
It is deployed behind a feature flag that is
**enabled by default**
.
[
GitLab administrators with access to the GitLab Rails console
](
../../administration/feature_flags.md
)
can opt to disable it.
To enable it:
```
ruby
Feature
.
enable
(
:quality_test_cases
,
Project
.
find_by_full_path
(
'<project_path>'
))
```
To disable it:
Users with Reporter or higher
[
permissions
](
../../user/permissions.md
)
can reopen test cases.
```
ruby
Feature
.
disable
(
:quality_test_cases
,
Project
.
find_by_full_path
(
'<project_path>'
))
```
To reopen an archived test case, on the test case's page, select
**Reopen test case**
.
doc/user/permissions.md
View file @
9ac23fee
...
...
@@ -62,9 +62,9 @@ The following table depicts the various user permission levels in a project.
| See a list of jobs | ✓ (
*3*
) | ✓ | ✓ | ✓ | ✓ |
| See a job log | ✓ (
*3*
) | ✓ | ✓ | ✓ | ✓ |
| Download and browse job artifacts | ✓ (
*3*
) | ✓ | ✓ | ✓ | ✓ |
| Create confidential issue | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create new issue | ✓ | ✓ | ✓ | ✓ | ✓ |
| See related issues | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create confidential issue | ✓ | ✓ | ✓ | ✓ | ✓ |
| View
[
Releases
](
project/releases/index.md
)
| ✓ (
*6*
) | ✓ | ✓ | ✓ | ✓ |
| View requirements
**(ULTIMATE)**
| ✓ | ✓ | ✓ | ✓ | ✓ |
| View Insights
**(ULTIMATE)**
| ✓ | ✓ | ✓ | ✓ | ✓ |
...
...
@@ -92,6 +92,10 @@ The following table depicts the various user permission levels in a project.
| Create new merge request | | ✓ | ✓ | ✓ | ✓ |
| View metrics dashboard annotations | | ✓ | ✓ | ✓ | ✓ |
| Create/edit requirements
**(ULTIMATE)**
| | ✓ | ✓ | ✓ | ✓ |
| Create new
[
test case
](
../ci/test_cases/index.md
)
| | ✓ | ✓ | ✓ | ✓ |
| Archive
[
test case
](
../ci/test_cases/index.md
)
| | ✓ | ✓ | ✓ | ✓ |
| Move
[
test case
](
../ci/test_cases/index.md
)
| | ✓ | ✓ | ✓ | ✓ |
| Reopen
[
test case
](
../ci/test_cases/index.md
)
| | ✓ | ✓ | ✓ | ✓ |
| Pull
[
packages
](
packages/index.md
)
| | ✓ | ✓ | ✓ | ✓ |
| Publish
[
packages
](
packages/index.md
)
| | | ✓ | ✓ | ✓ |
| Create/edit/delete a Cleanup policy | | | ✓ | ✓ | ✓ |
...
...
ee/app/controllers/projects/quality/test_cases_controller.rb
View file @
9ac23fee
...
...
@@ -5,13 +5,8 @@ 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
:authorize_create_issue!
,
only:
[
:new
]
before_action
do
push_frontend_feature_flag
(
:quality_test_cases
,
project
,
default_enabled:
true
)
end
feature_category
:quality_management
def
index
...
...
@@ -44,10 +39,6 @@ class Projects::Quality::TestCasesController < Projects::ApplicationController
private
def
verify_test_cases_flag!
render_404
unless
Feature
.
enabled?
(
:quality_test_cases
,
project
,
default_enabled:
true
)
end
def
test_cases_finder
IssuesFinder
.
new
(
current_user
,
project_id:
project
.
id
,
issue_types: :test_case
)
end
...
...
ee/app/services/quality_management/test_cases/create_service.rb
View file @
9ac23fee
...
...
@@ -43,7 +43,7 @@ module QualityManagement
end
def
can_create_test_cases?
project
.
feature_available?
(
:quality_management
)
&&
Feature
.
enabled?
(
:quality_test_cases
,
project
,
default_enabled:
true
)
project
.
feature_available?
(
:quality_management
)
end
end
end
...
...
ee/app/views/layouts/nav/_test_cases_link.html.haml
View file @
9ac23fee
-
return
unless
Feature
.
enabled?
(
:quality_test_cases
,
project
,
default_enabled:
true
)
-
return
unless
project
.
feature_available?
(
:quality_management
)
-
return
unless
can?
(
current_user
,
:read_issue
,
project
)
...
...
ee/changelogs/unreleased/remove_quality_test_cases_flag.yml
0 → 100644
View file @
9ac23fee
---
title
:
Allow users to manage test cases
merge_request
:
49491
author
:
type
:
added
ee/config/feature_flags/development/quality_test_cases.yml
deleted
100644 → 0
View file @
ae1f26ee
---
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
milestone
:
'
13.4'
type
:
development
group
:
group::certify
default_enabled
:
true
ee/spec/controllers/projects/quality/test_cases_controller_spec.rb
View file @
9ac23fee
...
...
@@ -24,18 +24,6 @@ RSpec.describe Projects::Quality::TestCasesController do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
render_template
(
template
)
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
...
...
ee/spec/requests/api/graphql/mutations/quality_management/test_cases/create_spec.rb
View file @
9ac23fee
...
...
@@ -80,14 +80,6 @@ RSpec.describe 'Create test case' do
it_behaves_like
'an invalid argument to the mutation'
,
argument_name: :not_valid
end
context
'when quality_test_cases flag is disabled'
do
before
do
stub_feature_flags
(
quality_test_cases:
false
)
end
it_behaves_like
'a mutation that returns errors in the response'
,
errors:
[
"Test cases are not available for this project"
]
end
end
context
'when user cannot create test cases'
do
...
...
ee/spec/services/quality_management/test_cases/create_service_spec.rb
View file @
9ac23fee
...
...
@@ -48,17 +48,6 @@ RSpec.describe QualityManagement::TestCases::CreateService do
expect
(
new_issue
.
labels
.
map
(
&
:title
)).
to
eq
([
label
.
title
])
end
end
context
'when quality_test_cases feature flag is disabled'
do
before
do
stub_feature_flags
(
quality_test_cases:
false
)
end
it
'responds with errors'
do
expect
(
service
.
execute
).
to
be_error
expect
(
service
.
execute
.
message
).
to
eq
(
"Test cases are not available for this project"
)
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