Skip to content

Add coverage data for report viewer#2846

Draft
Kr0nox wants to merge 2 commits intodevelopfrom
report-viewer/pr-coverage
Draft

Add coverage data for report viewer#2846
Kr0nox wants to merge 2 commits intodevelopfrom
report-viewer/pr-coverage

Conversation

@Kr0nox
Copy link
Copy Markdown
Member

@Kr0nox Kr0nox commented Mar 4, 2026

This PR adds a test coverage report for the report-viewer.

The tests get executed for each package and then a script bundles them into a single report.

The action then posts a comment containing:

  • The overview for the entire report viewer with the 4 available coverage metrics
  • A collapsable section with the metrics for each package
  • A collapse section with the metrics for each testable file

An HTML version of the report where a per line analysis can be seen is attached to the action run

If the line coverage falls below 20% the action fails

We should discuss whether the line coverage is what we want for this or whether we should use a different metric or even a composed one like sonarcloud does.
We should discuss if we want a simple message like the one below or put in the work to create a more styled one with colors for different values

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 4, 2026

=============================== Coverage summary ===============================
Statements   : 34.19% ( 514/1503 )
Branches     : 22.33% ( 161/721 )
Functions    : 30.47% ( 142/466 )
Lines        : 34.71% ( 495/1426 )
================================================================================
Per Package Coverage

model

=============================== Coverage summary ===============================
Statements   : 38.7% ( 48/124 )
Branches     : 15.78% ( 6/38 )
Functions    : 17.07% ( 7/41 )
Lines        : 36.66% ( 44/120 )
================================================================================

parser

=============================== Coverage summary ===============================
Statements   : 66.66% ( 98/147 )
Branches     : 45.83% ( 22/48 )
Functions    : 81.13% ( 43/53 )
Lines        : 65.94% ( 91/138 )
================================================================================

report-viewer

=============================== Coverage summary ===============================
Statements   : 80.85% ( 114/141 )
Branches     : 61.97% ( 44/71 )
Functions    : 93.54% ( 29/31 )
Lines        : 80.71% ( 113/140 )
================================================================================

ui-components

=============================== Coverage summary ===============================
Statements   : 23.28% ( 254/1091 )
Branches     : 15.78% ( 89/564 )
Functions    : 18.47% ( 63/341 )
Lines        : 24.02% ( 247/1028 )
================================================================================
Per File Coverage
------------------------------------------------|---------|----------|---------|---------|--------------------------------------------------------------------------------------------
File                                            | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                                                          
------------------------------------------------|---------|----------|---------|---------|--------------------------------------------------------------------------------------------
All files                                       |   34.19 |    22.33 |   30.47 |   34.71 |                                                                                            
 model/src                                      |    38.7 |    15.78 |   17.07 |   36.66 |                                                                                            
  BaseCodeReport.ts                             |       0 |      100 |       0 |       0 | 6                                                                                          
  Comparison.ts                                 |       0 |        0 |       0 |       0 | 29-114                                                                                     
  Distribution.ts                               |     100 |      100 |     100 |     100 |                                                                                            
  Language.ts                                   |   82.14 |       50 |      50 |   81.48 | 36-43                                                                                      
  Match.ts                                      |       0 |      100 |       0 |       0 | 39                                                                                         
  MatchInSingleFile.ts                          |       0 |        0 |       0 |       0 | 11-72                                                                                      
  MetricJsonIdentifier.ts                       |     100 |      100 |     100 |     100 |                                                                                            
  RunInformation.ts                             |   41.17 |      100 |   14.28 |    37.5 | 30-50                                                                                      
  Version.ts                                    |   23.52 |        0 |   33.33 |   23.52 | 18-51                                                                                      
 parser/src/factories                           |   90.74 |    73.33 |   97.72 |   90.09 |                                                                                            
  BaseCodeReportFactory.ts                      |      25 |      100 |   66.66 |      25 | 8-13                                                                                       
  ClusterFactory.ts                             |     100 |      100 |     100 |     100 |                                                                                            
  ComparisonFactory.ts                          |   91.17 |    69.56 |     100 |   90.16 | 72,154-158,171,176                                                                         
  DistributionFactory.ts                        |     100 |      100 |     100 |     100 |                                                                                            
  OptionsFactory.ts                             |   85.71 |       50 |     100 |   85.71 | 34                                                                                         
  RunInformationFactory.ts                      |     100 |      100 |     100 |     100 |                                                                                            
  SubmissionMappingsFactory.ts                  |     100 |      100 |     100 |     100 |                                                                                            
  TopComparisonFactory.ts                       |     100 |      100 |     100 |     100 |                                                                                            
 parser/src/fileHandler                         |       0 |        0 |       0 |       0 |                                                                                            
  ReportFileHandler.ts                          |       0 |        0 |       0 |       0 | 10-107                                                                                     
 report-viewer/src/stores                       |   80.43 |    61.97 |   93.54 |   80.29 |                                                                                            
  reportStore.ts                                |   80.43 |    61.97 |   93.54 |   80.29 | 55,106,112,126,129,140-141,146,152,159,166,174,180-183,187,193,199,205,211,226,315,331-348 
 report-viewer/src/version                      |     100 |      100 |     100 |     100 |                                                                                            
  versions.ts                                   |     100 |      100 |     100 |     100 |                                                                                            
 ui-components/base                             |   93.45 |    93.65 |   96.87 |   93.13 |                                                                                            
  ButtonComponent.vue                           |     100 |      100 |     100 |     100 |                                                                                            
  ContainerComponent.vue                        |     100 |      100 |     100 |     100 |                                                                                            
  DropDownSelector.vue                          |     100 |      100 |     100 |     100 |                                                                                            
  InfoIcon.vue                                  |     100 |      100 |     100 |     100 |                                                                                            
  InteractableComponent.vue                     |     100 |      100 |     100 |     100 |                                                                                            
  LoadingCircle.vue                             |      50 |        0 |     100 |      50 | 2                                                                                          
  ScrollableComponent.vue                       |   14.28 |        0 |       0 |   14.28 | 5,15-24                                                                                    
  SearchBarComponent.vue                        |     100 |      100 |     100 |     100 |                                                                                            
  TabbedContainer.vue                           |     100 |      100 |     100 |     100 |                                                                                            
  TextInformation.vue                           |     100 |      100 |     100 |     100 |                                                                                            
  ToastComponent.vue                            |     100 |      100 |     100 |     100 |                                                                                            
  ToolTipComponent.vue                          |     100 |      100 |     100 |     100 |                                                                                            
 ui-components/style                            |      25 |        0 |       0 |      25 |                                                                                            
  graphColor.ts                                 |      25 |        0 |       0 |      25 | 20-36                                                                                      
 ui-components/widget                           |      70 |    33.33 |   41.66 |   72.41 |                                                                                            
  MetricIcon.vue                                |     100 |      100 |     100 |     100 |                                                                                            
  MetricType.ts                                 |      75 |      100 |   45.45 |      75 | 32,60-99                                                                                   
  NameElement.vue                               |      40 |        0 |       0 |      50 | 8-31                                                                                       
 ui-components/widget/clusterVisualization      |    3.41 |        0 |       0 |    3.58 |                                                                                            
  ClusterGraph.vue                              |    2.51 |        0 |       0 |     2.6 | 27-90,104-301,308-516                                                                      
  ClusterRadarChart.vue                         |    8.57 |        0 |       0 |    9.67 | 11,58-145                                                                                  
 ui-components/widget/comparisonTable           |   23.83 |    11.81 |      10 |   24.75 |                                                                                            
  ComparisonSorting.ts                          |   36.11 |    30.76 |   15.38 |   37.14 | 33,38,48,53,58,63,69-76,95-106,110-120                                                     
  ComparisonTable.vue                           |    17.1 |        0 |       0 |    17.8 | 7-11,28,41,46-53,66,71-79,97-137,149-156,194,206-471,478-524                               
  ComparisonTableFilter.vue                     |    92.3 |       90 |   83.33 |    92.3 | 48                                                                                         
  HueGenerator.ts                               |       0 |      100 |       0 |       0 | 6-35                                                                                       
 ui-components/widget/distributionVisualization |    4.04 |        0 |       0 |    4.59 |                                                                                            
  BoxPlot.vue                                   |    2.85 |        0 |       0 |     3.4 | 8-235                                                                                      
  BoxPlotDiagramOptions.vue                     |   16.66 |        0 |       0 |      20 | 10-25                                                                                      
  DistributionDiagram.vue                       |    3.89 |        0 |       0 |    4.16 | 10-238                                                                                     
  DistributionDiagramOptions.vue                |      10 |        0 |       0 |   11.11 | 10-47                                                                                      
 ui-components/widget/fileDisplaying            |   11.48 |     1.25 |    1.14 |   11.67 |                                                                                            
  CodeHighlighter.ts                            |       0 |        0 |       0 |       0 | 17-78                                                                                      
  CodeLine.vue                                  |       0 |        0 |       0 |       0 | 3-156                                                                                      
  CodePanel.vue                                 |   11.42 |        0 |       0 |   12.12 | 5-9,14,25,31-34,42-167                                                                     
  FileSortingOptions.ts                         |     100 |      100 |     100 |     100 |                                                                                            
  FilesContainer.vue                            |    3.89 |        0 |       0 |    4.22 | 5,16-228                                                                                   
  MatchColors.ts                                |   14.28 |        0 |       0 |   14.28 | 15-25                                                                                      
  MatchList.vue                                 |   32.65 |        0 |       0 |   35.55 | 10-21,30-65,74-75,97,113,145-213                                                           
 ui-components/widget/optionsSelectors          |     100 |    92.85 |     100 |     100 |                                                                                            
  MetricSelector.vue                            |     100 |      100 |     100 |     100 |                                                                                            
  OptionComponent.vue                           |     100 |      100 |     100 |     100 |                                                                                            
  OptionsSelectorComponent.vue                  |     100 |     87.5 |     100 |     100 | 8                                                                                          
------------------------------------------------|---------|----------|---------|---------|--------------------------------------------------------------------------------------------

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 4, 2026

@Kr0nox
Copy link
Copy Markdown
Member Author

Kr0nox commented Mar 5, 2026

Goal: Coverage on new Code

@Kr0nox Kr0nox marked this pull request as draft March 5, 2026 12:32
@tsaglam
Copy link
Copy Markdown
Member

tsaglam commented Mar 5, 2026

Is this not something that could be done via Sonar? Or did you decide specifically against sonar-based coverage?

@Kr0nox
Copy link
Copy Markdown
Member Author

Kr0nox commented Mar 5, 2026

I think it is easily possible to do this with sonar. The only disadvantage would be that sonarcloud and the unit tests would either need to be in the same action or sonarcloud needs to depend on the unit tests and thus only get executed when tests are successful

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.

2 participants