summaryrefslogtreecommitdiff
path: root/app/controllers/projects
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/pipelines_controller.rb21
1 files changed, 14 insertions, 7 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index 106ef1b72c1..6770ff37d91 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -156,14 +156,21 @@ class Projects::PipelinesController < Projects::ApplicationController
def test_report
return unless Feature.enabled?(:junit_pipeline_view, project)
- if pipeline_test_report == :error
- render json: { status: :error_parsing_report }
- return
- end
+ respond_to do |format|
+ format.html do
+ render 'show'
+ end
- render json: TestReportSerializer
- .new(current_user: @current_user)
- .represent(pipeline_test_report)
+ format.json do
+ if pipeline_test_report == :error
+ render json: { status: :error_parsing_report }
+ else
+ render json: TestReportSerializer
+ .new(current_user: @current_user)
+ .represent(pipeline_test_report)
+ end
+ end
+ end
end
private