Commit bf1ae705 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'sh-remove-junit-pipeline-screenshots-view-feature-flag' into 'master'

Remove the junit_pipeline_screenshots_view flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!61075
parents 37140d73 ec7020a0
...@@ -20,6 +20,6 @@ class TestCaseEntity < Grape::Entity ...@@ -20,6 +20,6 @@ class TestCaseEntity < Grape::Entity
alias_method :test_case, :object alias_method :test_case, :object
def can_read_screenshots? def can_read_screenshots?
Feature.enabled?(:junit_pipeline_screenshots_view, options[:project]) && test_case.has_attachment? test_case.has_attachment?
end end
end end
---
title: Show unit report attachments in the pipeline test report
merge_request: 61075
author:
type: added
---
name: junit_pipeline_screenshots_view
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/31029
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/202114
milestone: '13.0'
type: development
group: group::verify testing
default_enabled: false
...@@ -333,32 +333,17 @@ If parsing JUnit report XML results in an error, an indicator is shown next to t ...@@ -333,32 +333,17 @@ If parsing JUnit report XML results in an error, an indicator is shown next to t
## Viewing JUnit screenshots on GitLab ## Viewing JUnit screenshots on GitLab
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/202114) in GitLab 13.0. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/202114) in GitLab 13.0 behind the `:junit_pipeline_screenshots_view` feature flag, disabled by default.
> - It's deployed behind a feature flag, disabled by default. > - The feature flag was removed and was [made generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/216979) in GitLab 13.12.
> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enabling-the-junit-screenshots-feature). **(FREE SELF)**
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
When [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/6061) is complete, the attached file is visible on the pipeline details page.
If JUnit report format XML files contain an `attachment` tag, GitLab parses the attachment. If JUnit report format XML files contain an `attachment` tag, GitLab parses the attachment.
Upload your screenshots as [artifacts](yaml/README.md#artifactsreportsjunit) to GitLab. The `attachment` tag **must** contain the absolute path to the screenshots you uploaded.
```xml ```xml
<testcase time="1.00" name="Test"> <testcase time="1.00" name="Test">
<system-out>[[ATTACHMENT|/absolute/path/to/some/file]]</system-out> <system-out>[[ATTACHMENT|/absolute/path/to/some/file]]</system-out>
</testcase> </testcase>
``` ```
### Enabling the JUnit screenshots feature **(FREE SELF)** Upload your screenshots as [artifacts](yaml/README.md#artifactsreportsjunit) to GitLab. The `attachment` tag **must** contain the absolute path to the screenshots you uploaded.
This feature comes with the `:junit_pipeline_screenshots_view` feature flag disabled by default.
To enable this feature, ask a GitLab administrator with [Rails console access](../administration/feature_flags.md#how-to-enable-and-disable-features-behind-flags) to run the
following command:
```ruby A link to the test case attachment will appear in the test case details in [the pipeline test report](#viewing-unit-test-reports-on-gitlab).
Feature.enable(:junit_pipeline_screenshots_view)
```
...@@ -976,11 +976,6 @@ RSpec.describe Projects::PipelinesController do ...@@ -976,11 +976,6 @@ RSpec.describe Projects::PipelinesController do
end end
end end
context 'when junit_pipeline_screenshots_view is enabled' do
before do
stub_feature_flags(junit_pipeline_screenshots_view: project)
end
context 'when test_report contains attachment and scope is with_attachment as a URL param' do context 'when test_report contains attachment and scope is with_attachment as a URL param' do
let(:pipeline) { create(:ci_pipeline, :with_test_reports_attachment, project: project) } let(:pipeline) { create(:ci_pipeline, :with_test_reports_attachment, project: project) }
...@@ -1003,24 +998,6 @@ RSpec.describe Projects::PipelinesController do ...@@ -1003,24 +998,6 @@ RSpec.describe Projects::PipelinesController do
expect(json_response["test_suites"]).to be_empty expect(json_response["test_suites"]).to be_empty
end end
end end
end
context 'when junit_pipeline_screenshots_view is disabled' do
before do
stub_feature_flags(junit_pipeline_screenshots_view: false)
end
context 'when test_report contains attachment and scope is with_attachment as a URL param' do
let(:pipeline) { create(:ci_pipeline, :with_test_reports_attachment, project: project) }
it 'returns a test reports without attachment_url' do
get_test_report_json(scope: 'with_attachment')
expect(response).to have_gitlab_http_status(:ok)
expect(json_response["test_suites"].first["test_cases"].first).not_to include("attachment_url")
end
end
end
def get_test_report_json(**args) def get_test_report_json(**args)
params = { params = {
......
...@@ -41,11 +41,6 @@ RSpec.describe TestCaseEntity do ...@@ -41,11 +41,6 @@ RSpec.describe TestCaseEntity do
end end
end end
context 'when feature is enabled' do
before do
stub_feature_flags(junit_pipeline_screenshots_view: true)
end
context 'when attachment is present' do context 'when attachment is present' do
let(:test_case) { build(:report_test_case, :failed_with_attachment, job: job) } let(:test_case) { build(:report_test_case, :failed_with_attachment, job: job) }
...@@ -62,27 +57,4 @@ RSpec.describe TestCaseEntity do ...@@ -62,27 +57,4 @@ RSpec.describe TestCaseEntity do
end end
end end
end end
context 'when feature is disabled' do
before do
stub_feature_flags(junit_pipeline_screenshots_view: false)
end
context 'when attachment is present' do
let(:test_case) { build(:report_test_case, :failed_with_attachment, job: job) }
it 'returns no attachment_url' do
expect(subject).not_to include(:attachment_url)
end
end
context 'when attachment is not present' do
let(:test_case) { build(:report_test_case, job: job) }
it 'returns no attachment_url' do
expect(subject).not_to include(:attachment_url)
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