Skip to content

Use addFileAttribute in jest-junit config

Miranda Fluharty requested to merge mf-add-file-attribute-to-jest-artifact into master

What does this MR do?

In #119032 (closed), we added a column to the Unit Test Report to display the test file name (/spec/frontend/something/something_spec.js) for each test case. But our jest tests don't pass the file name into the XML artifact they generate, so the new column is blank 😭

This MR adds the addFileAttribute option to our jest-junit config, which sets the JEST_JUNIT_ADD_FILE_ATTRIBUTE environment variable when the tests run, which outputs the file name for each test case into the properties for its <testcase> tag in the junit_jest.xml artifact. This MR enables the new column added in #119032 (closed) to display the file name associated with each of our jest test cases 😃

This change does not need a changelog entry:

Any developer-facing change (e.g., refactoring, technical debt remediation, test suite changes) should not have a changelog entry.

Screenshots

😭 😃
Screen_Shot_2020-10-13_at_11.31.03 Screen_Shot_2020-10-13_at_11.36.03

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 Miranda Fluharty

Merge request reports