Commit a3083700 authored by Phil Hughes's avatar Phil Hughes

Merge branch '216478-remove-test-report-feature-flag' into 'master'

Remove junit report feature flag

See merge request gitlab-org/gitlab!39260
parents bbd574e3 d1748b2b
...@@ -93,10 +93,6 @@ const createPipelineHeaderApp = mediator => { ...@@ -93,10 +93,6 @@ const createPipelineHeaderApp = mediator => {
}; };
const createTestDetails = () => { const createTestDetails = () => {
if (!window.gon?.features?.junitPipelineView) {
return;
}
const el = document.querySelector('#js-pipeline-tests-detail'); const el = document.querySelector('#js-pipeline-tests-detail');
const { summaryEndpoint, suiteEndpoint } = el?.dataset || {}; const { summaryEndpoint, suiteEndpoint } = el?.dataset || {};
......
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
return `${this.pipelinePath}/test_report`; return `${this.pipelinePath}/test_report`;
}, },
showViewFullReport() { showViewFullReport() {
return Boolean(this.glFeatures.junitPipelineView) && this.pipelinePath.length; return this.pipelinePath.length;
}, },
}, },
created() { created() {
......
...@@ -43,7 +43,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo ...@@ -43,7 +43,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action do before_action do
push_frontend_feature_flag(:vue_issuable_sidebar, @project.group) push_frontend_feature_flag(:vue_issuable_sidebar, @project.group)
push_frontend_feature_flag(:junit_pipeline_view, @project.group)
end end
around_action :allow_gitaly_ref_name_caching, only: [:index, :show, :discussions] around_action :allow_gitaly_ref_name_caching, only: [:index, :show, :discussions]
......
...@@ -12,7 +12,6 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -12,7 +12,6 @@ class Projects::PipelinesController < Projects::ApplicationController
before_action :authorize_create_pipeline!, only: [:new, :create] before_action :authorize_create_pipeline!, only: [:new, :create]
before_action :authorize_update_pipeline!, only: [:retry, :cancel] before_action :authorize_update_pipeline!, only: [:retry, :cancel]
before_action do before_action do
push_frontend_feature_flag(:junit_pipeline_view, project)
push_frontend_feature_flag(:filter_pipelines_search, project, default_enabled: true) push_frontend_feature_flag(:filter_pipelines_search, project, default_enabled: true)
push_frontend_feature_flag(:dag_pipeline_tab, project, default_enabled: true) push_frontend_feature_flag(:dag_pipeline_tab, project, default_enabled: true)
push_frontend_feature_flag(:pipelines_security_report_summary, project) push_frontend_feature_flag(:pipelines_security_report_summary, project)
...@@ -177,8 +176,6 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -177,8 +176,6 @@ class Projects::PipelinesController < Projects::ApplicationController
end end
def test_report def test_report
return unless Feature.enabled?(:junit_pipeline_view, project)
respond_to do |format| respond_to do |format|
format.html do format.html do
render 'show' render 'show'
......
- return if pipeline_has_errors - return if pipeline_has_errors
- test_reports_enabled = Feature.enabled?(:junit_pipeline_view, @project)
- dag_pipeline_tab_enabled = Feature.enabled?(:dag_pipeline_tab, @project, default_enabled: true) - dag_pipeline_tab_enabled = Feature.enabled?(:dag_pipeline_tab, @project, default_enabled: true)
.tabs-holder .tabs-holder
...@@ -20,7 +19,6 @@ ...@@ -20,7 +19,6 @@
= link_to failures_project_pipeline_path(@project, @pipeline), data: { target: '#js-tab-failures', action: 'failures', toggle: 'tab' }, class: 'failures-tab' do = link_to failures_project_pipeline_path(@project, @pipeline), data: { target: '#js-tab-failures', action: 'failures', toggle: 'tab' }, class: 'failures-tab' do
= _('Failed Jobs') = _('Failed Jobs')
%span.badge.badge-pill.js-failures-counter= @pipeline.failed_builds.count %span.badge.badge-pill.js-failures-counter= @pipeline.failed_builds.count
- if test_reports_enabled
%li.js-tests-tab-link %li.js-tests-tab-link
= link_to test_report_project_pipeline_path(@project, @pipeline), data: { target: '#js-tab-tests', action: 'test_report', toggle: 'tab' }, class: 'test-tab' do = link_to test_report_project_pipeline_path(@project, @pipeline), data: { target: '#js-tab-tests', action: 'test_report', toggle: 'tab' }, class: 'test-tab' do
= s_('TestReports|Tests') = s_('TestReports|Tests')
......
---
title: JUnit test report on pipeline detail page
merge_request: 39260
author:
type: added
...@@ -103,10 +103,10 @@ Some feature flags can be enabled or disabled on a per project basis: ...@@ -103,10 +103,10 @@ Some feature flags can be enabled or disabled on a per project basis:
Feature.enable(:<feature flag>, Project.find(<project id>)) Feature.enable(:<feature flag>, Project.find(<project id>))
``` ```
For example, to enable the [`:junit_pipeline_view`](../ci/junit_test_reports.md#enabling-the-junit-test-reports-feature-core-only) feature flag for project `1234`: For example, to enable the [`:product_analytics`](../operations/product_analytics.md#enable-or-disable-product-analytics) feature flag for project `1234`:
```ruby ```ruby
Feature.enable(:junit_pipeline_view, Project.find(1234)) Feature.enable(:product_analytics, Project.find(1234))
``` ```
`Feature.enable` and `Feature.disable` always return `nil`, this is not an indication that the command failed: `Feature.enable` and `Feature.disable` always return `nil`, this is not an indication that the command failed:
......
...@@ -239,9 +239,8 @@ Test: ...@@ -239,9 +239,8 @@ Test:
## Viewing JUnit test reports on GitLab ## Viewing JUnit test reports on GitLab
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24792) in GitLab 12.5. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24792) in GitLab 12.5 behind a feature flag (`junit_pipeline_view`), disabled by default.
> - It's deployed behind a feature flag, disabled by default. > - The feature flag was removed and the feature was [made generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/216478) in GitLab 13.3.
> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enabling-the-junit-test-reports-feature-core-only). **(CORE ONLY)**
If JUnit XML files are generated and uploaded as part of a pipeline, these reports If JUnit XML files are generated and uploaded as part of a pipeline, these reports
can be viewed inside the pipelines details page. The **Tests** tab on this page will can be viewed inside the pipelines details page. The **Tests** tab on this page will
...@@ -254,22 +253,6 @@ details, including the cases that make up the suite. ...@@ -254,22 +253,6 @@ details, including the cases that make up the suite.
You can also retrieve the reports via the [GitLab API](../api/pipelines.md#get-a-pipelines-test-report). You can also retrieve the reports via the [GitLab API](../api/pipelines.md#get-a-pipelines-test-report).
### Enabling the JUnit test reports feature **(CORE ONLY)**
This feature comes with the `:junit_pipeline_view` feature flag disabled by default. This
feature is disabled due to some performance issues with very large data sets.
When [the performance is improved](https://gitlab.com/groups/gitlab-org/-/epics/2854), the feature will be enabled 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
Feature.enable(:junit_pipeline_view)
# Enable the feature for a specific project, GitLab 13.0 and above only.
Feature.enable(:junit_pipeline_view, Project.find(<your-project-id-here>))
```
## 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.
......
...@@ -110,15 +110,13 @@ module API ...@@ -110,15 +110,13 @@ module API
end end
desc 'Gets the test report for a given pipeline' do desc 'Gets the test report for a given pipeline' do
detail 'This feature was introduced in GitLab 13.0. Disabled by default behind feature flag `junit_pipeline_view`' detail 'This feature was introduced in GitLab 13.0.'
success TestReportEntity success TestReportEntity
end end
params do params do
requires :pipeline_id, type: Integer, desc: 'The pipeline ID' requires :pipeline_id, type: Integer, desc: 'The pipeline ID'
end end
get ':id/pipelines/:pipeline_id/test_report' do get ':id/pipelines/:pipeline_id/test_report' do
not_found! unless Feature.enabled?(:junit_pipeline_view, user_project)
authorize! :read_build, pipeline authorize! :read_build, pipeline
present pipeline.test_reports, with: TestReportEntity, details: true present pipeline.test_reports, with: TestReportEntity, details: true
......
...@@ -859,11 +859,6 @@ RSpec.describe Projects::PipelinesController do ...@@ -859,11 +859,6 @@ RSpec.describe Projects::PipelinesController do
end end
end end
context 'when feature is enabled' do
before do
stub_feature_flags(junit_pipeline_view: project)
end
context 'when pipeline does not have a test report' do context 'when pipeline does not have a test report' do
it 'renders an empty test report' do it 'renders an empty test report' do
get_test_report_json get_test_report_json
...@@ -875,9 +870,7 @@ RSpec.describe Projects::PipelinesController do ...@@ -875,9 +870,7 @@ RSpec.describe Projects::PipelinesController do
context 'when pipeline has a test report' do context 'when pipeline has a test report' do
before do before do
create(:ci_build, name: 'rspec', pipeline: pipeline).tap do |build| create(:ci_build, :test_reports, name: 'rspec', pipeline: pipeline)
create(:ci_job_artifact, :junit, job: build)
end
end end
it 'renders the test report' do it 'renders the test report' do
...@@ -890,9 +883,7 @@ RSpec.describe Projects::PipelinesController do ...@@ -890,9 +883,7 @@ RSpec.describe Projects::PipelinesController do
context 'when pipeline has a corrupt test report artifact' do context 'when pipeline has a corrupt test report artifact' do
before do before do
create(:ci_build, name: 'rspec', pipeline: pipeline).tap do |build| create(:ci_build, :broken_test_reports, name: 'rspec', pipeline: pipeline)
create(:ci_job_artifact, :junit_with_corrupted_data, job: build)
end
get_test_report_json get_test_report_json
end end
...@@ -952,22 +943,6 @@ RSpec.describe Projects::PipelinesController do ...@@ -952,22 +943,6 @@ RSpec.describe Projects::PipelinesController do
end end
end end
end end
end
context 'when feature is disabled' do
let(:pipeline) { create(:ci_empty_pipeline, project: project) }
before do
stub_feature_flags(junit_pipeline_view: false)
end
it 'renders empty response' do
get_test_report_json
expect(response).to have_gitlab_http_status(:no_content)
expect(response.body).to be_empty
end
end
def get_test_report_json(**args) def get_test_report_json(**args)
params = { params = {
......
...@@ -15,7 +15,6 @@ RSpec.describe Projects::PipelinesController, "(JavaScript fixtures)", type: :co ...@@ -15,7 +15,6 @@ RSpec.describe Projects::PipelinesController, "(JavaScript fixtures)", type: :co
before do before do
sign_in(user) sign_in(user)
stub_feature_flags(junit_pipeline_view: project)
end end
it "pipelines/test_report.json" do it "pipelines/test_report.json" do
......
...@@ -20,10 +20,7 @@ describe('Grouped test reports app', () => { ...@@ -20,10 +20,7 @@ describe('Grouped test reports app', () => {
let wrapper; let wrapper;
let mockStore; let mockStore;
const mountComponent = ({ const mountComponent = ({ props = { pipelinePath } } = {}) => {
glFeatures = { junitPipelineView: false },
props = { pipelinePath },
} = {}) => {
wrapper = mount(Component, { wrapper = mount(Component, {
store: mockStore, store: mockStore,
localVue, localVue,
...@@ -35,9 +32,6 @@ describe('Grouped test reports app', () => { ...@@ -35,9 +32,6 @@ describe('Grouped test reports app', () => {
methods: { methods: {
fetchReports: () => {}, fetchReports: () => {},
}, },
provide: {
glFeatures,
},
}); });
}; };
...@@ -78,15 +72,6 @@ describe('Grouped test reports app', () => { ...@@ -78,15 +72,6 @@ describe('Grouped test reports app', () => {
}); });
describe('`View full report` button', () => { describe('`View full report` button', () => {
it('should not render the full test report link', () => {
expect(findFullTestReportLink().exists()).toBe(false);
});
describe('With junitPipelineView feature flag enabled', () => {
beforeEach(() => {
mountComponent({ glFeatures: { junitPipelineView: true } });
});
it('should render the full test report link', () => { it('should render the full test report link', () => {
const fullTestReportLink = findFullTestReportLink(); const fullTestReportLink = findFullTestReportLink();
...@@ -94,12 +79,10 @@ describe('Grouped test reports app', () => { ...@@ -94,12 +79,10 @@ describe('Grouped test reports app', () => {
expect(pipelinePath).not.toBe(''); expect(pipelinePath).not.toBe('');
expect(fullTestReportLink.attributes('href')).toBe(`${pipelinePath}/test_report`); expect(fullTestReportLink.attributes('href')).toBe(`${pipelinePath}/test_report`);
}); });
});
describe('Without a pipelinePath', () => { describe('Without a pipelinePath', () => {
beforeEach(() => { beforeEach(() => {
mountComponent({ mountComponent({
glFeatures: { junitPipelineView: true },
props: { pipelinePath: '' }, props: { pipelinePath: '' },
}); });
}); });
......
...@@ -735,11 +735,6 @@ RSpec.describe API::Ci::Pipelines do ...@@ -735,11 +735,6 @@ RSpec.describe API::Ci::Pipelines do
let(:pipeline) { create(:ci_pipeline, project: project) } let(:pipeline) { create(:ci_pipeline, project: project) }
context 'when feature is enabled' do
before do
stub_feature_flags(junit_pipeline_view: true)
end
context 'when pipeline does not have a test report' do context 'when pipeline does not have a test report' do
it 'returns an empty test report' do it 'returns an empty test report' do
subject subject
...@@ -762,8 +757,7 @@ RSpec.describe API::Ci::Pipelines do ...@@ -762,8 +757,7 @@ RSpec.describe API::Ci::Pipelines do
context 'when pipeline has corrupt test reports' do context 'when pipeline has corrupt test reports' do
before do before do
job = create(:ci_build, pipeline: pipeline) create(:ci_build, :broken_test_reports, name: 'rspec', pipeline: pipeline)
create(:ci_job_artifact, :junit_with_corrupted_data, job: job, project: project)
end end
it 'returns a suite_error' do it 'returns a suite_error' do
...@@ -775,19 +769,6 @@ RSpec.describe API::Ci::Pipelines do ...@@ -775,19 +769,6 @@ RSpec.describe API::Ci::Pipelines do
end end
end end
context 'when feature is disabled' do
before do
stub_feature_flags(junit_pipeline_view: false)
end
it 'renders empty response' do
subject
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
context 'unauthorized user' do context 'unauthorized user' do
it 'does not return project pipelines' do it 'does not return project pipelines' do
get api("/projects/#{project.id}/pipelines/#{pipeline.id}/test_report", non_member) get api("/projects/#{project.id}/pipelines/#{pipeline.id}/test_report", non_member)
......
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