Comments (9)
I cannot get the tests to work on GitHub Actions: https://github.com/sebastianbergmann/phpcov/actions/runs/4136062962/jobs/7149383819
@Slamdunk @localheinz Any idea what I might be doing wrong? Thanks!
from phpcov.
The tests are failing for me locally as well.
Running
vendor/bin/phpunit --configuration=phpunit.xml
yields
PHPUnit 10.0.7 by Sebastian Bergmann and contributors.
Runtime: PHP 8.1.14
Configuration: phpunit.xml
..SSS....FF......... 20 / 20 (100%)
Time: 00:00.738, Memory: 6.00 MB
There were 2 failures:
1) /Users/am/Sites/sebastianbergmann/phpcov/tests/end-to-end/merge/valid-directory-with-text-report-stdout.phpt
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
Generating code coverage report in text format ...
-Code Coverage Report:
- %s
-
- Summary:
- Classes: 100.00% (1/1)
- Methods: 100.00% (2/2)
- Lines: 66.67% (2/3)
-
-SebastianBergmann\PHPCOV\TestFixture\Greeter
- Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 2/ 2)
+Code Coverage Report:
+ 2023-02-09 16:15:39
+
+ Summary:
+ Classes: (0/0)
+ Methods: (0/0)
+ Lines: (0/0)
/Users/am/Sites/sebastianbergmann/phpcov/tests/end-to-end/merge/valid-directory-with-text-report-stdout.phpt:20
2) /Users/am/Sites/sebastianbergmann/phpcov/tests/end-to-end/merge/valid-directory-with-text-report.phpt
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
int(0)
-Code Coverage Report:
- %s
-
- Summary:
- Classes: 100.00% (1/1)
- Methods: 100.00% (2/2)
- Lines: 66.67% (2/3)
-
-SebastianBergmann\PHPCOV\TestFixture\Greeter
- Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 2/ 2)
+Code Coverage Report:
+ 2023-02-09 16:15:39
+
+ Summary:
+ Classes: (0/0)
+ Methods: (0/0)
+ Lines: (0/0)
/Users/am/Sites/sebastianbergmann/phpcov/tests/end-to-end/merge/valid-directory-with-text-report.phpt:28
FAILURES!
Tests: 20, Assertions: 17, Failures: 2, Skipped: 3.
from phpcov.
They work for me locally:
$ XDEBUG_MODE=coverage php -d pcov.enabled=0 vendor/bin/phpunit
PHPUnit 10.0-dev by Sebastian Bergmann and contributors.
Runtime: PHP 8.2.2
Configuration: /usr/local/src/phpcov/phpunit.xml
S.................SS 20 / 20 (100%)
Time: 00:01.268, Memory: 6.00 MB
OK, but some tests were skipped!
Tests: 20, Assertions: 17, Skipped: 3.
from phpcov.
The reason why the suite fails with PCOV is in its readme:
When
pcov.directory
is left unset, PCOV will attempt to findsrc
,lib
orapp
in the current working directory, in that order; If none are found the current directory will be used, which may waste resources storing coverage information for the test suite.
There is a src
dir, so tests
gets excluded. If you manually set tests
as the collection directory, it works again with PCOV too:
$ php -d pcov.enabled=1 -d pcov.directory=tests vendor/bin/phpunit
PHPUnit 10.0.7 by Sebastian Bergmann and contributors.
Runtime: PHP 8.2.2
Configuration: /usr/local/src/phpcov/phpunit.xml
.................... 20 / 20 (100%)
Time: 00:00.783, Memory: 6.00 MB
OK (20 tests, 20 assertions)
I also bet this is the reason the update-fixture
target didn't work when you run it @sebastianbergmann
from phpcov.
We configure the setup-php
action to set up Xdebug for code coverage, not PCOV (https://github.com/sebastianbergmann/phpcov/blob/main/.github/workflows/ci.yml#L73).
PHPUnit prints that it is using Xdebug, not PCOV (https://github.com/sebastianbergmann/phpcov/actions/runs/4136354441/jobs/7150093791#step:5:11).
I am confused :-/
from phpcov.
That's another issue: tests/fixture/example/coverage/*.cov
files have /usr/local/src/phpcov/[...]
as the hardcoded path for the produced coverage data.
Indeed to get the test pass I had to move the project under /usr/local/src
on my local PC.
I guess the only way is to recreate fixtures before each test run, so it can be easily managed both locally and on CI
from phpcov.
You are absolutely right!
from phpcov.
After 337d169 I now run into https://github.com/sebastianbergmann/phpcov/actions/runs/4141720052/jobs/7161596636#step:7:35 because of https://github.com/sebastianbergmann/phpcov/blob/main/tests/end-to-end/patch-coverage/valid-arguments-with-valid-path-prefix.phpt#L11.
Now we "just" need to make $_SERVER['argv'][3] = '/usr/local/src/phpcov';
dynamic.
from phpcov.
Now we "just" need to make
$_SERVER['argv'][3] = '/usr/local/src/phpcov';
dynamic.
Et voilà: 166b95b
from phpcov.
Related Issues (20)
- Code Coverage data serialized from PHPUnit PHAR cannot be processed by PHPCOV HOT 10
- Syntax error when running phpcov.phar HOT 2
- Error on nikic/PhpParser/Lexer.php HOT 4
- PHP 8 Support HOT 1
- Deal with merging coverage files, generated with different base paths HOT 3
- Docker official image HOT 2
- Docs. Wich version to use. HOT 2
- Is there a way to turn a Clover XML file to HTML (or something else more readable than XML)? HOT 2
- PHP 8 support HOT 1
- Support phpunit/phpunit ^10 and phpunit/php-code-coverage ^10 HOT 3
- Issue with latest release __PHP_Incomplete_Class HOT 3
- Session modification issues with phpcov execute HOT 1
- Support for PHPUnit 10.2 HOT 3
- HTML Coverage Reports for Patch-Coverage HOT 1
- Field width too long
- Support for `11.0.0` version of `phpunit/php-code-coverage` HOT 2
- Test Failure(s)
- Merge JUnit files HOT 1
- I get an error message:zend_mm_heap corrupted HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpcov.