Skip to content

Filter a TestReport by attachment

Max Orefice requested to merge mo-add-filtering-by-attachment-for-junit into master

Part of #202114 (closed), following up !27243 (merged)

What does this MR do?

This MR adds filtering logic by attachment for a TestReport.

It creates 2 methods which modify existing hashes in order to return only the data containing an attachment.

This is the endpoint that will be affected in a follow up MR:

endpoint scope
pipelines/60/test_report.json with_attachment

We will render this data when frontend is sending us the scope=with_attachment URL param. Here how it could potentially look like:

if params[:scope] == 'with_attachment'
  pipeline_test_report.with_attachment!
end

Note: This data is currently not persisted and everything is lazy loaded when needed + memoized.

Why are we adding this?

This will allow us to render all TestReports containing an attachment to the frontend.

Today's problem

It's not currently possible to filter out our TestReport. We are working on making possible to link a screenshot for a given test failure.

Today, if a failure happens we need to inspect the job artifacts manually which takes time and it's a hard task for us internally.

Solution

We want to make it simple for the user to display a screenshot associated to a test failure. This way we can show a failing screenshot on a pipeline without browsing all the job artifacts manually.

Check the design for this feature.

Screenshots

Test report without attachment

Mozilla_Firefox_2020-03-25_16-25-29

Test report with attachment

Mozilla_Firefox_2020-03-25_16-25-44

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Max Orefice

Merge request reports