sasjs / cli

Command line interface for creating, compiling, and building SAS® projects
https://cli.sasjs.io
MIT License
37 stars 5 forks source link

Generate LCOV file using sasjs test #929

Closed allanbowe closed 2 years ago

allanbowe commented 3 years ago

Whilst we don't currently test the line coverage for sas programs (that's a future exercise) the LCOV report remains a common standard for coverage reporting. If we are able to produce one, it would mean we could integrate with coveralls.io as part of a github action, improving our quality score on npms.io

The proposal is to create a testResults.lcov file alongside testResults.csv, testResults.xml and testResults.json

The file will look like this:

TN:
SF:./some/folder/covered1.sas
FNF:1
FNH:1
LF:1
LH:1
BRF:1
BRH:1
end_of_record
TN:
SF:./some/folder/covered2.sas
FNF:1
FNH:1
LF:1
LH:1
BRF:1
BRH:1
end_of_record
TN:
SF:./some/folder/notcovered.sas
FNF:0
FNH:0
LF:0
LH:0
BRF:0
BRH:0
end_of_record

Every covered SAS file will be 1/1 for all dimensions, every uncovered SAS file will be 0/0

To test the results, you can npm install -g lcov-cli-report-viewer and run lcov-cli-report-viewer some.lcov

More information on the lcov abbreviations can be found here: https://manpages.debian.org/unstable/lcov/geninfo.1.en.html

allanbowe commented 3 years ago

Using the MCOVERAGE and MCOVERAGELOC system options, it should be possible to generate the line coverage at macro level: https://documentation.sas.com/doc/en/pgmsascdc/v_016/mcrolref/p0lt9hs8uc1g3an1g9om1rjc33n8.htm

ghost commented 2 years ago

:tada: This issue has been resolved in version 3.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: