Add code coverage report

Created on 19 April 2024, 5 months ago
Updated 6 May 2024, 4 months ago

Problem/Motivation

We should generate a code coverage report to see how our tests are doing... we'll probably have to refactor how the tests are run.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

11.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @alexpott
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    Making a core-mvp as this came out of @larowlan's review on ✨ Add recipes api as experimental API to core Needs review

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    Here's the current code coverage report... unfortunately can't get gitlab to generate it and report on it because it doesn't have xdebug or pcov installed and I can't install them (yet).

    Code Coverage Report:
      2024-04-21 20:54:36
    
     Summary:
      Classes: 61.11% (22/36)
      Methods: 70.81% (114/161)
      Lines:   88.02% (926/1052)
    
    Drupal\Core\Config\Action\Attribute\ActionMethod
      Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
    Drupal\Core\Config\Action\Attribute\ConfigAction
      Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  2/  2)
    Drupal\Core\Config\Action\ConfigActionException
      Methods:  ( 0/ 0)   Lines:  (  0/  0)
    Drupal\Core\Config\Action\ConfigActionManager
      Methods:  75.00% ( 3/ 4)   Lines:  97.62% ( 41/ 42)
    Drupal\Core\Config\Action\DuplicateConfigActionIdException
      Methods:  ( 0/ 0)   Lines:  (  0/  0)
    Drupal\Core\Config\Action\EntityMethodException
      Methods:  ( 0/ 0)   Lines:  (  0/  0)
    Drupal\Core\Config\Action\Exists
      Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  7/  7)
    Drupal\Core\Config\Action\Plugin\ConfigAction\Deriver\EntityCreateDeriver
      Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  6/  6)
    Drupal\Core\Config\Action\Plugin\ConfigAction\Deriver\EntityMethodDeriver
      Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 37/ 37)
    Drupal\Core\Config\Action\Plugin\ConfigAction\Deriver\PermissionsPerBundleDeriver
      Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 11/ 11)
    Drupal\Core\Config\Action\Plugin\ConfigAction\EntityCreate
      Methods:  66.67% ( 2/ 3)   Lines:  88.89% ( 16/ 18)
    Drupal\Core\Config\Action\Plugin\ConfigAction\EntityMethod
      Methods:  80.00% ( 4/ 5)   Lines:  95.65% ( 22/ 23)
    Drupal\Core\Config\Action\Plugin\ConfigAction\PermissionsPerBundle
      Methods:  75.00% ( 3/ 4)   Lines:  96.55% ( 28/ 29)
    Drupal\Core\Config\Action\Plugin\ConfigAction\SimpleConfigUpdate
      Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 10/ 10)
    Drupal\Core\Config\Checkpoint\Checkpoint
      Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
    Drupal\Core\Config\Checkpoint\CheckpointExistsException
      Methods:  ( 0/ 0)   Lines:  (  0/  0)
    Drupal\Core\Config\Checkpoint\CheckpointStorage
      Methods:  78.26% (18/23)   Lines:  96.64% (144/149)
    Drupal\Core\Config\Checkpoint\LinearHistory
      Methods:  77.78% ( 7/ 9)   Lines:  84.85% ( 28/ 33)
    Drupal\Core\Config\Checkpoint\NoCheckpointsException
      Methods:  ( 0/ 0)   Lines:  (  0/  0)
    Drupal\Core\Config\Checkpoint\UnknownCheckpointException
      Methods:  ( 0/ 0)   Lines:  (  0/  0)
    Drupal\Core\DefaultContent\Finder
      Methods: 100.00% ( 1/ 1)   Lines: 100.00% ( 31/ 31)
    Drupal\Core\DefaultContent\ImportException
      Methods:  ( 0/ 0)   Lines:  (  0/  0)
    Drupal\Core\DefaultContent\Importer
      Methods:  25.00% ( 2/ 8)   Lines:  86.29% (107/124)
    Drupal\Core\Recipe\ConfigConfigurator
      Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 36/ 36)
    Drupal\Core\Recipe\InstallConfigurator
      Methods:   0.00% ( 0/ 1)   Lines:  91.18% ( 31/ 34)
    Drupal\Core\Recipe\InvalidConfigException
      Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  7/  7)
    Drupal\Core\Recipe\Recipe
      Methods:  85.71% ( 6/ 7)   Lines:  99.28% (138/139)
    Drupal\Core\Recipe\RecipeAppliedEvent
      Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
    Drupal\Core\Recipe\RecipeCommand
      Methods:   0.00% ( 0/ 6)   Lines:   0.00% (  0/ 52)
    Drupal\Core\Recipe\RecipeConfigInstaller
      Methods: 100.00% ( 1/ 1)   Lines: 100.00% ( 22/ 22)
    Drupal\Core\Recipe\RecipeConfigStorageWrapper
      Methods: 100.00% (15/15)   Lines: 100.00% ( 27/ 27)
    Drupal\Core\Recipe\RecipeConfigurator
      Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 10/ 10)
    Drupal\Core\Recipe\RecipeDiscovery
      Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)
    Drupal\Core\Recipe\RecipeExtensionConfigStorage
      Methods:  28.57% ( 4/14)   Lines:  56.25% ( 18/ 32)
    Drupal\Core\Recipe\RecipeFileException
      Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  5/  5)
    Drupal\Core\Recipe\RecipeMissingExtensionsException
      Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  6)
    Drupal\Core\Recipe\RecipeOverrideConfigStorage
      Methods:  28.57% ( 4/14)   Lines:  36.00% (  9/ 25)
    Drupal\Core\Recipe\RecipePreExistingConfigException
      Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
    Drupal\Core\Recipe\RecipeRunner
      Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 45/ 45)
    Drupal\Core\Recipe\UnknownRecipeException
      Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
    Drupal\ckeditor5\Plugin\ConfigAction\AddItemToToolbar
      Methods:  66.67% ( 2/ 3)   Lines:  93.94% ( 31/ 33)
    Drupal\content_moderation\Plugin\ConfigAction\AddModeration
      Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 25/ 25)
    Drupal\content_moderation\Plugin\ConfigAction\AddModerationDeriver
      Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 17/ 17)
    

    I think I might add the html report to the repo so we can work on creating issues to expand the coverage.

  • First commit to issue fork.
  • Merge request !120Draft: Compare xdebug vs pcov #3442014 β†’ (Open) created by andypost
  • πŸ‡«πŸ‡·France andypost

    Created second MR (don't merge) to test related #3404084: Add PCOV extension to images β†’

  • Pipeline finished with Canceled
    5 months ago
    Total: 494s
    #152648
  • Pipeline finished with Failed
    5 months ago
    Total: 2593s
    #152652
  • Pipeline finished with Success
    5 months ago
    Total: 825s
    #152674
  • Pipeline finished with Success
    5 months ago
    Total: 1730s
    #152684
  • Pipeline finished with Success
    5 months ago
    Total: 4629s
    #152718
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Some good numbers there, would be neat to get the html version in the artifacts so you can browse it

    Looks like the importer is a bit short of coverage but everything else looks fairly decent πŸ‘Œ

  • Pipeline finished with Success
    5 months ago
    Total: 767s
    #152769
  • Pipeline finished with Failed
    5 months ago
    Total: 191s
    #152833
  • Pipeline finished with Failed
    5 months ago
    Total: 37s
    #152835
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
  • Status changed to RTBC 5 months ago
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
    • alexpott β†’ committed 2f82a07e on 11.x
      Issue #3442014 by alexpott, andypost, larowlan: Add code coverage report
      
    • alexpott β†’ committed 1e735c11 on 10.3.x
      Issue #3442014 by alexpott, andypost, larowlan: Add code coverage report...
  • Status changed to Fixed 5 months ago
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024