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

[ISSUE-36] Added coverage report workflow #37

Merged
merged 10 commits into from
Nov 9, 2022
Merged

[ISSUE-36] Added coverage report workflow #37

merged 10 commits into from
Nov 9, 2022

Conversation

lampajr
Copy link
Member

@lampajr lampajr commented Aug 17, 2022

Thank you for submitting this pull request

fix #36

Added following improvements:

  • New test:report npm script
  • Publish coverage report on Sonarcloud usign Github workflow (only the action package one)
  • Added some unit tests to improve the coverage

@lampajr lampajr mentioned this pull request Aug 19, 2022
@lampajr lampajr marked this pull request as ready for review August 19, 2022 14:54
@lampajr
Copy link
Member Author

lampajr commented Aug 19, 2022

Before adding unit tests:

-----------------------|---------|----------|---------|---------|----------------------------------------
File                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                      
-----------------------|---------|----------|---------|---------|----------------------------------------
All files              |   26.06 |     4.29 |    2.27 |   26.87 |                                        
 bin                   |    37.5 |    21.73 |   16.66 |   38.29 |                                        
  github-action.js     |   88.88 |       50 |     100 |   88.88 | 29                                     
  main.js              |   25.64 |     6.66 |       0 |   26.31 | 9,26-85,96                             
 lib                   |   16.07 |        0 |       0 |   16.36 |                                        
  common.js            |   17.85 |        0 |       0 |   18.51 | 9-13,18-20,27-59                       
  git-service.js       |   16.66 |        0 |       0 |   16.66 | 6-7,11-20,31-67,77-105,115-136,145-172 
  logger.js            |    12.5 |        0 |       0 |   13.04 | 4-8,16-49                              
 lib/github            |   24.13 |        0 |       0 |   26.92 |                                        
  main.js              |   24.13 |        0 |       0 |   26.92 | 52-61,65-71,95-189                     
 lib/jenkins           |   29.41 |        0 |       0 |      30 |                                        
  jenkins.service.js   |   47.05 |        0 |       0 |   47.05 | 7,12-20,24-32                          
  main.js              |   20.58 |        0 |       0 |   21.21 | 7-11,44-95                             
 utils                 |   34.42 |      7.4 |   11.11 |   34.42 |                                        
  bin-utils.js         |      80 |       25 |      50 |      80 | 14,20                                  
  date-util.js         |      50 |      100 |       0 |      50 | 2                                      
  file.utils.js        |   33.33 |        0 |       0 |   33.33 | 8-30                                   
  project-utils.js     |   33.33 |        0 |       0 |   33.33 | 4-10                                   
  pullrequest-utils.js |   13.63 |        0 |       0 |   13.63 | 10-61                                  
-----------------------|---------|----------|---------|---------|----------------------------------------

Below the results after adding some unit tests

-----------------------|---------|----------|---------|---------|---------------------------------------------
File                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                           
-----------------------|---------|----------|---------|---------|---------------------------------------------
All files              |   76.82 |    62.23 |   71.08 |   76.47 |                                             
 src/bin               |   95.83 |    65.21 |     100 |   95.74 |                                             
  github-action.js     |   88.88 |       50 |     100 |   88.88 | 29                                          
  main.js              |   97.43 |    73.33 |     100 |   97.36 | 96                                          
 src/lib               |   74.44 |    68.75 |      75 |   74.15 |                                             
  common.js            |     100 |      100 |     100 |     100 |                                             
  git-service.js       |   78.33 |    85.71 |      80 |   78.33 | 47,57-67,91,101-105,127,132-136,158,168-172 
  logger.js            |   58.33 |       45 |   63.63 |   56.52 | 8,16-17,27-28,30,35-42                      
 src/lib/github        |   91.37 |    63.33 |   95.45 |   90.38 |                                             
  main.js              |   91.37 |    63.33 |   95.45 |   90.38 | 135,147,174,180-181                         
 src/lib/jenkins       |   29.41 |        0 |       0 |      30 |                                             
  jenkins.service.js   |   47.05 |        0 |       0 |   47.05 | 7,12-20,24-32                               
  main.js              |   20.58 |        0 |       0 |   21.21 | 7-11,44-95                                  
 src/utils             |   88.52 |    81.48 |     100 |   88.52 |                                             
  bin-utils.js         |     100 |     87.5 |     100 |     100 | 11                                          
  date-util.js         |     100 |      100 |     100 |     100 |                                             
  file.utils.js        |     100 |      100 |     100 |     100 |                                             
  project-utils.js     |     100 |      100 |     100 |     100 |                                             
  pullrequest-utils.js |   68.18 |       60 |     100 |   68.18 | 27-42,61                                    
 test/support          |     100 |      100 |     100 |     100 |                                             
  mock-octokit.js      |     100 |      100 |     100 |     100 |                                             
-----------------------|---------|----------|---------|---------|---------------------------------------------

Copy link
Collaborator

@Ginxo Ginxo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Ginxo Ginxo merged commit e0493f5 into kiegroup:main Nov 9, 2022
@lampajr lampajr deleted the ISSUE-36_coverage branch November 9, 2022 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cover rest of packages/action JS files
2 participants