Commit 768d4f55 authored by Matija Čupić's avatar Matija Čupić

Feature gate PipelinesController#test_report

parent 226467f2
......@@ -154,6 +154,8 @@ class Projects::PipelinesController < Projects::ApplicationController
end
def test_report
return unless Feature.enabled?(:junit_pipeline_view, project)
if pipeline_test_report == :error
render json: { status: :error_parsing_report }
return
......
......@@ -408,6 +408,11 @@ describe Projects::PipelinesController do
format: :json
end
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
let(:pipeline) { create(:ci_pipeline, project: project) }
......@@ -447,6 +452,22 @@ describe Projects::PipelinesController do
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
end
describe 'GET latest' do
let(:branch_main) { project.repository.branches[0] }
let(:branch_secondary) { project.repository.branches[1] }
......
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