Comments (11)
Hello, Infection's creator here.
Thanks for looking into this and creating this issue.
@owenvoke can you please share an adapter you created for Pest? I wonder how you deal with TestFrameworkAdapter
interface and determining whether the test failed or not.
Regarding adapter: I would suggest creating an official repository at infection/pest-adapter
to be in line with already 3 implemented:
infection/phpspec-adapter
infection/codeception-adapter
- phpunit adapter (currently bundled into the core -
infection/infection
You can be maintainers of this repo if that matters.
Why "official" repository is better? because
- we have a feature to automatically install adapters when the user runs Infection and adapter is not found (see https://github.com/infection/infection/blob/0e83204401a077924718b32e2323dbe335e75f98/src/TestFramework/AdapterInstaller.php#L48-L86)
- we have for example extensions autodiscovery feature (read here https://github.com/infection/extension-installer)
- I would avoid adding any constants to the Infection core for non-official adapters just because they are not under control and we can't guarantee they are up to date. Probably, if you decide not to move it there, we need to find another way
FYI, adapters should have a special composer package's type infection-extension
to be autodiscovered and autoinstallable by our extensions-installer, e.g. see https://github.com/infection/codeception-adapter/blob/09dda58180bc3ba7ca3cb865ba0d0d84dfe3ef5a/composer.json#L4
Didn't dig into the Pest yet, but test framework should have some required features to be able to work efficiently with Infection, some of them are described here infection/infection#45 (comment). I guess if the Pest is just a wrapper for PHPUnit and works with PHPUnit's config, it shouldn't be an issue.
Anyway, I'm happy to help here.
from pest.
I might take a quick look at this tomorrow, just to see how it's done. 👍
from pest.
@owenvoke I guess we can create our own repository for this. Let's call it pest-plugin-infection
.
from pest.
Alright, I love infection - but at the moment I've no plans to work on this. Hopefully in the future someone will pick this.
from pest.
@tomasnorre Yeah - unfortunately my free time is very limited. And of course, someone else that needs infection in their test suite can submit a pull request that addresses this issue.
from pest.
I totally get that, I wasn't meant as a blame, was just hoping for it.
We just started using pest and I think that mutation tests are really valuable. Perhaps I get to the point where I will make a PR. But like you, I have limited free time too :)
Stay safe and take care.
from pest.
Right, I've taken a look and this is probably going to be complicated.
New adapters are created as an additional repository, I was thinking of a pestphp/infection-adapter
or, if Infection want to have it, an infection/pest-adapter
package. I've created a test version that is partially working, after making sure it uses the right executable, etc.
However it looks like the TestFrameworkConfigLocator
class is hardcoded to use {path}/{frameworkName}.{extension}
, whereas Pest uses the phpunit.xml
/phpunit.xml.dist
file. 😕 I can get round this by copying the phpunit.xml.dist
to pest.xml.dist
.
But after that, and some tweaking (hacks?)...
from pest.
This afternoon I going to create the template for that repository. Give me a couple hours.
from pest.
It looks like the only changes we'd need to PR to Infection is to add a Pest constant and entry to the TYPES
constant in TestFrameworkTypes
. 🎉 (At least, in master
)
from pest.
@maks-rafalko I think it's also an opportunity to adapt the config locator.
I don't think it makes sense anymore to have it in the core with hard-coded path when its responsibility is to locate the test framework config path, which depends on the test framework itself.
One way would be to move the interface directly in https://github.com/infection/abstract-testframework-adapter or it could even be completely hidden in the adapter, leaving the responsibility to have a dedicated class for that or not to each individual adapters. A non trivial question though is how all of that should interact with the TestFrameworkConfigPathProvider
(used for initializing Infection).
from pest.
Missing a sad smiley. But you are the maintainer, it's your call.
from pest.
Related Issues (20)
- [Bug]: Unknown option "--parallel". github workflow HOT 5
- [Bug]: Could not bind closure. HOT 1
- [Bug]: Text coverage not compatible with coverage-php HOT 1
- [Bug]: Running tests in parallel causes SQLSTATE[HY000] [2006] MySQL server has gone away
- [Bug]: method directoriesByNamespace replacing prefix multiple times resulting in false positive because the directory is not found
- [Bug]: No tests found when filter group with phpunit testcases HOT 1
- [Bug]: mixed-in expectation object causes IDE type errors
- [Bug]: Skipped installation of bin bin/paratest.bat for package brianium/paratest: name conflicts with an existing file HOT 6
- [Bug]: invalid dataset not showing as FAILED when running with --parallel
- [Bug]: Pest + PHP Matcher = simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found
- [Bug]: Pest option --list-groups
- [Bug]: --update-snapshots deletes all snapshots
- Call to undefined method TestCase::get() HOT 1
- No debug functions test cousing memory leak (with Filament installed)
- [Bug]: Wrong Exception message
- [Bug]: arch-testing#expect-toBeUsed with debugging functions HOT 1
- [Bug]: How to set a global variable in Pest.php use beforeAll()
- [Bug]: support php 8.4 HOT 2
- [Bug]: Fatal Error when using PHPStan\dumpType
- [Bug]: PHPStan namespace is not discoverable by plugin-arch
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 pest.