What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi! Has anyone tipps/tools for generating a good code coverage report for a spryker shop? We tried u

U0121G9LVNC
U0121G9LVNC Posts: 27 🧑🏻‍🚀 - Cadet

Hi! Has anyone tipps/tools for generating a good code coverage report for a spryker shop?
We tried using the codeception coverage with pcov but it seems to ignore configured excludes/filenames. What is the best way to go?

Comments

  • Alberto Reyer
    Alberto Reyer Posts: 690 🪐 - Explorer

    The following excludes all Spryker stuff we don’t want to cover (Facades, Factories, etc.).
    This is working fine for us with pcov.

    coverage:
      enabled: true
      remote: false
      include:
        - 'src/Pyz/Zed/*.php'
      exclude:
        - 'src/Pyz/Zed/*/Business/*Facade.php'
        - 'src/Pyz/Zed/*/Business/*FacadeInterface.php'
        - 'src/Pyz/Zed/*/Business/*BusinessFactory.php'
        - 'src/Pyz/Zed/*/Communication/*CommunicationFactory.php'
        - 'src/Pyz/Zed/*/Persistence/*PersistenceFactory.php'
        - 'src/Pyz/Zed/*/Persistence/*QueryContainer.php'
        - 'src/Pyz/Zed/*/Persistence/*EntityManager.php'
        - 'src/Pyz/Zed/*/Persistence/*Repository.php'
        - 'src/Pyz/Zed/*DependencyProvider.php'
        - 'src/Pyz/Zed/*Config.php'
    
  • Alberto Reyer
    Alberto Reyer Posts: 690 🪐 - Explorer

    This is only for unittests, for Glue API tests I experimented with the remote code coverage, but weren’t able to generate a code coverage

  • U0121G9LVNC
    U0121G9LVNC Posts: 27 🧑🏻‍🚀 - Cadet

    Thanks @UL6DGRULR. Did you need to set any pcov.exclude values in your dockerfile?

  • Alberto Reyer
    Alberto Reyer Posts: 690 🪐 - Explorer

    No, we have only configured Codeception for the code coverage. It would be more efficient to configure pcov.exclude as well, but as the coverage generation is fast enough for us we didn’t looked into it

  • U0121G9LVNC
    U0121G9LVNC Posts: 27 🧑🏻‍🚀 - Cadet

    and another question: are you running php-unit 8?

  • Alberto Reyer
    Alberto Reyer Posts: 690 🪐 - Explorer

    We run php-unit 8.5

  • U0121G9LVNC
    U0121G9LVNC Posts: 27 🧑🏻‍🚀 - Cadet

    Thanks a lot!