UI tests replacement with RTL/Jest/new BigTest version (FAT-92)

[FOLIO-3050] Report Jest test coverage in Sonarqube Created: 02/Mar/21  Updated: 08/Jun/21  Resolved: 10/Mar/21

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None
Parent: UI tests replacement with RTL/Jest/new BigTest version

Type: Task Priority: TBD
Reporter: John Malconian Assignee: John Malconian
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Sprint: DevOps Sprint 109, DevOps Sprint 108
Development Team: FOLIO DevOps
Epic Link: UI tests replacement with RTL/Jest/new BigTest version

 Description   

Make Jest test coverage reports the only coverage report that is imported into Sonarqube for Nodejs-based repositories.



 Comments   
Comment by John Malconian [ 08/Mar/21 ]

As of today, there are a total of 18 UI/Stripes modules that include some kind of Jest unit tests. Of these 18, 11 are configured to generate their coverage report in the directory './artifacts/coverage'. The remaining 7 are configured to generate their coverage report in the directory './artifacts/coverage-jest'. The coverage report directory is defined by the 'coverageDirectory' parameter in the 'jest.config.js' file located in the root directory of the repos that contain Jest unit tests. The problem with defining the coverage report directory as './artifacts/coverage' is that BigTest outputs its coverage report to the same location. So if repos contain both Jest and some other unit test framework, we cannot guarantee that the coverage report imported into Sonarqube will be from Jest. The 11 repos that currently have their Jest coverage directory set to './artifacts/coverage' are:

ui-circulation-log
ui-plugin-bursar-export
stripes-util
ui-quick-marc
ui-remote-storage
ui-eholdings
ui-notes
ui-data-import
ui-plugin-find-organization
ui-plugin-find-package-title
ui-myprofile

I recommend that Jest unit tests generate their coverage report to a standard, Jest-only location. './artifacts/coverage-jest' and configure the CI pipeline to have Sonarqube only analyze the coverage report in that location. The 11 repos listed above will need to be updated with the new location.

Comment by John Malconian [ 08/Mar/21 ]

PR with needed code changes to shared Jenkins pipeline libs - https://github.com/folio-org/jenkins-pipeline-libs/pull/118
SQ branch of ui-orders with code coverage for Jest only - https://sonarcloud.io/dashboard?id=org.folio%3Aui-orders&branch=FOLIO-3050-test&resolved=false

Comment by John Malconian [ 10/Mar/21 ]

I've reconfigured the coverage report path of those 11 or so repos and merged changes.

Generated at Thu Feb 08 23:25:14 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.