Strange behaviour on merging code-coverage of laravel-code tested by browser-kit-testing

106 Views Asked by At

Hi crowd intelligence!

I have different testsuites that are processed parallel in teamcity with .cov-files as artifacts and one build-configuration that does a merge of the code-coverage.

The strange thing is: code that is tested with the browser-kit-testing methods of laravel in such a way

$this->visitRoute('route.name', ['any'=>'params']);
$this->see('any text');
$this->seeElement('#myContainer');

will be correctly shown in code-coverage of the testsuite itself

only real lines of code are marked as covered - curly brackets are white

but after merging the code-coverage with the other results, these codes won't be completely covered anymore because the curly brackets and other structure-code are marked as not executed

after merge structure-code like curly brackets that should not count in code-coverage is marked red

our setup:

  • running phpunit 9
  • with php7.4
  • and laravel 6.x
  • in docker-containers
  • with alpine-based custom-image
  • code-coverage via pcov (it is much faster than xdebug)
  • in the beginning it worked very fine in this constellation
  • maybe any updates in pcov / phpunit / laravel / browser-kit-testing caused this problem?!
  • but we have no idea why it works in single coverage-output but not in merged
  • merging via phpcov
  • also tried nimut/phpunit-merger - same results
  • other code (e.g. some service-classes) that was tested with default phpunit-methods is also perfect covered after merging... it seems only code that is covered by browser-kit-testing is not clearly defined in .cov-file ?!

Anyone that has the same problem (or better: a solution) ?

0

There are 0 best solutions below