Commit a43505bc authored by Thong Kuah's avatar Thong Kuah

Merge branch 'remove_quality_test_cases_flag' into 'master'

Remove quality test cases feature flag

See merge request gitlab-org/gitlab!49491
parents c54bfbce 9ac23fee
...@@ -8,12 +8,8 @@ type: reference ...@@ -8,12 +8,8 @@ type: reference
# Test Cases **(ULTIMATE)** # Test Cases **(ULTIMATE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233479) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 13.6. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233479) in GitLab 13.6.
> - It's [deployed behind a feature flag](../../user/feature_flags.md), enabled by default. > - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/241983) in GitLab 13.7.
> - [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)**
Test cases in GitLab can help your teams create testing scenarios in their existing development platform. 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 ...@@ -22,6 +18,8 @@ use external test planning tools, which require additional overhead, context swi
## Create a test case ## 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: To create a test case in a GitLab project:
1. Navigate to **CI/CD > Test Cases**. 1. Navigate to **CI/CD > Test Cases**.
...@@ -34,6 +32,8 @@ To create a test case in a GitLab project: ...@@ -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 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. 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) ![Test case list page](img/test_case_list_v13_6.png)
To view a test case: To view a test case:
...@@ -43,10 +43,27 @@ 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) ![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 ## 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. 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 archive a test case, on the test case's page, select the **Archive test case** button.
To view archived test cases: To view archived test cases:
...@@ -58,23 +75,6 @@ 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. 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. Users with Reporter or higher [permissions](../../user/permissions.md) can reopen test cases.
### 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:
```ruby To reopen an archived test case, on the test case's page, select **Reopen test case**.
Feature.disable(:quality_test_cases, Project.find_by_full_path('<project_path>'))
```
...@@ -63,9 +63,9 @@ The following table depicts the various user permission levels in a project. ...@@ -63,9 +63,9 @@ The following table depicts the various user permission levels in a project.
| See a job log | ✓ (*3*) | ✓ | ✓ | ✓ | ✓ | | See a job log | ✓ (*3*) | ✓ | ✓ | ✓ | ✓ |
| See a job with [debug logging](../ci/variables/README.md#debug-logging) | | | ✓ | ✓ | ✓ | | See a job with [debug logging](../ci/variables/README.md#debug-logging) | | | ✓ | ✓ | ✓ |
| Download and browse job artifacts | ✓ (*3*) | ✓ | ✓ | ✓ | ✓ | | Download and browse job artifacts | ✓ (*3*) | ✓ | ✓ | ✓ | ✓ |
| Create confidential issue | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create new issue | ✓ | ✓ | ✓ | ✓ | ✓ | | Create new issue | ✓ | ✓ | ✓ | ✓ | ✓ |
| See related issues | ✓ | ✓ | ✓ | ✓ | ✓ | | See related issues | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create confidential issue | ✓ | ✓ | ✓ | ✓ | ✓ |
| View [Releases](project/releases/index.md) | ✓ (*6*) | ✓ | ✓ | ✓ | ✓ | | View [Releases](project/releases/index.md) | ✓ (*6*) | ✓ | ✓ | ✓ | ✓ |
| View requirements **(ULTIMATE)** | ✓ | ✓ | ✓ | ✓ | ✓ | | View requirements **(ULTIMATE)** | ✓ | ✓ | ✓ | ✓ | ✓ |
| View Insights **(ULTIMATE)** | ✓ | ✓ | ✓ | ✓ | ✓ | | View Insights **(ULTIMATE)** | ✓ | ✓ | ✓ | ✓ | ✓ |
...@@ -93,6 +93,10 @@ The following table depicts the various user permission levels in a project. ...@@ -93,6 +93,10 @@ The following table depicts the various user permission levels in a project.
| Create new merge request | | ✓ | ✓ | ✓ | ✓ | | Create new merge request | | ✓ | ✓ | ✓ | ✓ |
| View metrics dashboard annotations | | ✓ | ✓ | ✓ | ✓ | | View metrics dashboard annotations | | ✓ | ✓ | ✓ | ✓ |
| Create/edit requirements **(ULTIMATE)** | | ✓ | ✓ | ✓ | ✓ | | 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) | | ✓ | ✓ | ✓ | ✓ | | Pull [packages](packages/index.md) | | ✓ | ✓ | ✓ | ✓ |
| Publish [packages](packages/index.md) | | | ✓ | ✓ | ✓ | | Publish [packages](packages/index.md) | | | ✓ | ✓ | ✓ |
| Create/edit/delete a Cleanup policy | | | ✓ | ✓ | ✓ | | Create/edit/delete a Cleanup policy | | | ✓ | ✓ | ✓ |
......
...@@ -5,13 +5,8 @@ class Projects::Quality::TestCasesController < Projects::ApplicationController ...@@ -5,13 +5,8 @@ class Projects::Quality::TestCasesController < Projects::ApplicationController
before_action :check_quality_management_available! before_action :check_quality_management_available!
before_action :authorize_read_issue! before_action :authorize_read_issue!
before_action :verify_test_cases_flag!
before_action :authorize_create_issue!, only: [:new] 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 feature_category :quality_management
def index def index
...@@ -44,10 +39,6 @@ class Projects::Quality::TestCasesController < Projects::ApplicationController ...@@ -44,10 +39,6 @@ class Projects::Quality::TestCasesController < Projects::ApplicationController
private private
def verify_test_cases_flag!
render_404 unless Feature.enabled?(:quality_test_cases, project, default_enabled: true)
end
def test_cases_finder def test_cases_finder
IssuesFinder.new(current_user, project_id: project.id, issue_types: :test_case) IssuesFinder.new(current_user, project_id: project.id, issue_types: :test_case)
end end
......
...@@ -43,7 +43,7 @@ module QualityManagement ...@@ -43,7 +43,7 @@ module QualityManagement
end end
def can_create_test_cases? 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 end
end end
......
- return unless Feature.enabled?(:quality_test_cases, project, default_enabled: true)
- return unless project.feature_available?(:quality_management) - return unless project.feature_available?(:quality_management)
- return unless can?(current_user, :read_issue, project) - return unless can?(current_user, :read_issue, project)
......
---
title: Allow users to manage test cases
merge_request: 49491
author:
type: added
---
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
...@@ -24,18 +24,6 @@ RSpec.describe Projects::Quality::TestCasesController do ...@@ -24,18 +24,6 @@ RSpec.describe Projects::Quality::TestCasesController do
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(template) expect(response).to render_template(template)
end 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 end
context 'when feature is not available' do context 'when feature is not available' do
......
...@@ -80,14 +80,6 @@ RSpec.describe 'Create test case' do ...@@ -80,14 +80,6 @@ RSpec.describe 'Create test case' do
it_behaves_like 'an invalid argument to the mutation', argument_name: :not_valid it_behaves_like 'an invalid argument to the mutation', argument_name: :not_valid
end 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 end
context 'when user cannot create test cases' do context 'when user cannot create test cases' do
......
...@@ -48,17 +48,6 @@ RSpec.describe QualityManagement::TestCases::CreateService do ...@@ -48,17 +48,6 @@ RSpec.describe QualityManagement::TestCases::CreateService do
expect(new_issue.labels.map(&:title)).to eq([label.title]) expect(new_issue.labels.map(&:title)).to eq([label.title])
end end
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
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment