Comments (8)
This module's dependents may still benefit from having code coverage, so I plan to look into this anyway.
from codeception-psalm-module.
Can you elaborate on what you're trying to achieve?
from codeception-psalm-module.
using code coverage to make sure I've got a gherkin snippet for all the test cases I've written in the plugin.
from codeception-psalm-module.
note for reference: psalm/plugin-phpunit uses this module but doesn't have coverage enabled so I don't have a reference point to figure out what I'm doing wrong :s
from codeception-psalm-module.
Hm, ok. I don't think it would be easy, if possible at all. What this module does, roughly, is this:
- Extract the snippet and combine it with preamble
- Put it into a file
- Run Psalm on that file and collect the issues it reports
- Let you make assertions on the collected issues
Since Psalm is run as an external binary, it's not imediately clear to me how to enable code coverage collection during its run, and how to get coverage data out of it.
from codeception-psalm-module.
Possibly it could be done by running Psalm like this:
PSALM_ALLOW_XDEBUG=1 php -dauto_prepend_file=start-coverage.php -dauto_append_file=stop-coverage.php $(which psalm) --threads=1
Where start-coverage.php
and stop-coverage.php
would contain something along the lines of https://github.com/sebastianbergmann/php-code-coverage#usage
Alternatively, a modified copy of c3 (https://github.com/Codeception/c3) could be injected into Psalm environment. As there won't be any webserver running, it would have to be changed to communicate with Codeception by some non-HTTP means.
from codeception-psalm-module.
The latter approach seem technically feasible:
- It should be possible to include
c3
in an auto_prepend file - It should be possible to control it through env vars, e.g.
HTTP_X_CODECEPTION_CODECOVERAGE=1 PSALM_ALLOW_XDEBUG=1 php -dauto_prepend_file=c3.php $(which psalm) --threads=1 ... REQUEST_URI=/c3/phpunit $(which psalm) REQUEST_URI=/c3/clear $(which psalm)
from codeception-psalm-module.
@weirdan do you think it'd be more practical to re-open vimeo/psalm#3977 so one could just use phpunit ?
from codeception-psalm-module.
Related Issues (10)
- Bump requirements HOT 2
- Allow invoking psalm with xdebug enabled HOT 3
- Test Marked As Passed Even If Different Error Type Is Returned HOT 2
- Drop LegacyVersions (muglug/package-versions-56) support
- Tests fail because totallyTyped is now deprecated in 4.x HOT 1
- query: re psalm cache & docker HOT 5
- Add `--no-cache` to psalm commands HOT 3
- I see no errors does not check if psalm ran successfully HOT 3
- [Enhancement] Allow asserting that psalm returned a certain exit code 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 codeception-psalm-module.