Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(aws-cdk): (enable text output in jest coverage reporters) #26078

Closed
1 of 2 tasks
mrpackethead opened this issue Jun 22, 2023 · 4 comments · Fixed by #26881
Closed
1 of 2 tasks

(aws-cdk): (enable text output in jest coverage reporters) #26078

mrpackethead opened this issue Jun 22, 2023 · 4 comments · Fixed by #26881
Assignees
Labels
@aws-cdk/aws-config Related to AWS Config effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@mrpackethead
Copy link

Describe the feature

A very small change here, to turn on text output for jest testing. Being able to get something that looks like the output below would be very helpful. The coverage reports are avaialble as html in other folders, but this gives the information very concisely where it is needed.

I do not think this would break anything. I've had it turned on for my work on the L2 Construct for lattice and i get clean builds both for my package and the bigger library.

=============================== Coverage summary ===============================
Statements   : 78.8% ( 238/302 )
Branches     : 56.14% ( 96/171 )
Functions    : 84.31% ( 43/51 )
Lines        : 80.67% ( 238/295 )
================================================================================
-------------------|---------|----------|---------|---------|-------------------------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                   
-------------------|---------|----------|---------|---------|-------------------------------------
All files          |    78.8 |    56.14 |   84.31 |   80.67 |                                     
 index.ts          |     100 |      100 |     100 |     100 |                                     
 listener.ts       |   91.66 |    82.19 |     100 |   92.52 | 294,298,302-303,335,396,401,406     
 logging.ts        |     100 |      100 |      75 |     100 |                                     
 service.ts        |   86.66 |    66.66 |   83.33 |   89.65 | 229,233,257                         
 servicenetwork.ts |   81.53 |    77.77 |   78.57 |   86.88 | 211,219,299,307,311,361,470-472     
 targetgroups.ts   |    87.5 |      100 |     100 |     100 |                                     
 targets.ts        |    52.5 |    24.32 |   78.57 |    52.5 | 144-147,182-185,215,227-230,351-402 
-------------------|---------|----------|---------|---------|-------------------------------------
Jest: "global" coverage threshold for statements (80%) not met: 78.8%
Jest: "global" coverage threshold for branches (80%) not met: 56.14%

in tools/@aws-cdk/cdk-build-tools/config/jest.config.js line 16-20, add 'text' to the arrary

coverageReporters: [
"lcov",
"html",
"text-summary",
"text",
],

Use Case

Its painful to have to open the html files, particually when i dont' ahve a browser easily avaiable

Proposed Solution

Add 'text' to the coverageReporters

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.85.0

Environment details (OS name and version, etc.)

N/A

@mrpackethead mrpackethead added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jun 22, 2023
@github-actions github-actions bot added the @aws-cdk/aws-config Related to AWS Config label Jun 22, 2023
@pahud
Copy link
Contributor

pahud commented Jun 22, 2023

Yeah having a text output would be great!

@pahud pahud added p2 effort/medium Medium work item – several days of effort effort/small Small work item – less than a day of effort and removed effort/medium Medium work item – several days of effort needs-triage This issue or PR still needs to be triaged. labels Jun 22, 2023
@mrpackethead
Copy link
Author

@pahud , i could raise a PR for this, its a trivia should we do that?

@mrgrain
Copy link
Contributor

mrgrain commented Aug 24, 2023

We should definitely do this!

@mrgrain mrgrain self-assigned this Aug 24, 2023
@mergify mergify bot closed this as completed in #26881 Aug 25, 2023
mergify bot pushed a commit that referenced this issue Aug 25, 2023
For people working over SSH, that can't comfortably look at `coverage/index.html`, generate `coverage/coverage.txt` instead.

Closes #26078

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-config Related to AWS Config effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants