Skip to content

Jobs fail without coverage specification for Xdebug #372

Description

@SimonFrings

We are currently switching to github actions to check our test suite.
Therefore we're using the same structure in every ci.yml, for example:

name: CI

on:
 push:
 pull_request:

jobs:
 PHPUnit:
   runs-on: ubuntu-20.04
   strategy:
     matrix:
       php:
         - 7.4
         - 7.3
         - 7.2
         - 7.1
         - 7.0
   steps:
     - uses: actions/checkout@v2
     - name: Setup PHP
       uses: shivammathur/setup-php@v2
       with:
         php-version: ${{ matrix.php }}
     - run: composer install
     - run: vendor/bin/phpunit --coverage-text
       if: ${{ matrix.php >= 7.3 }}
     - run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
       if: ${{ matrix.php < 7.3 }}

As today we are facing failing jobs in all projects using the file above that were fine a day ago. (we didn't change anything)
Message:

Run vendor/bin/phpunit --coverage-text
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.

Code coverage needs to be enabled in php.ini by setting 'xdebug.mode' to 'coverage'
Error: Process completed with exit code 2.

This problem occurs in different PHP versions.
If you take a look at my jobs you can see that PHP 7.1 is green with PHUnit 7.5.20 and PHP 7.3 fails with the same PHPUnit version.

Adding coverage: xdebug to our ci.yml fixes the problem.
But it cant be the solution going through every project adding this line to every ci.yml, right?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions