Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Pest testing framework #1476

Closed
olivernybroe opened this issue Jan 25, 2021 · 5 comments
Closed

Add support for Pest testing framework #1476

olivernybroe opened this issue Jan 25, 2021 · 5 comments

Comments

@olivernybroe
Copy link

PestPHP is a testing framework inspired by JEST.

It uses PhpUnit underneath, so it should be relatively straightforward to support.

An issue has been created in Pest for this, however looking at the discussion it also seems like infection prefers the package to be under their organisation. pestphp/pest#4

Problems

Some major issues for supporting Pest without any changes in pest, is that the TestFrameworkConfigLocator is determining based on the config name.

However Pest is build on PhpUnit, so their config file is actually also just named phpunit.xml. (This can be solved in Pest by Pest allowing a config file named pest.xml and then infection would only work if you rename your config file.

@olivernybroe
Copy link
Author

@owenvoke do you still have the adapter you created where you got infection php working?

@maks-rafalko
Copy link
Member

I started working on Pest integration on top of PHPUnit adapter at that point in time.

There was a blocker in Pest though - pestphp/pest#48.

Seems like I had some progress with that issue - pestphp/pest#48 (comment) - but it still requires more work, probably from someone who is familiar with Pest, as currently Junit report doesn't work as expected, but Infection requires it.

After this issue is resolved, I can continue work on creating an adapter

@olivernybroe
Copy link
Author

@maks-rafalko Ah awesome.

Does infection only support reading Junit reports? Because Pest does have a TeamCity printer where those issues has been fixed.

However if it does not, then I might be able to look into that and fix the Junit report also.

@maks-rafalko
Copy link
Member

maks-rafalko commented Jan 25, 2021

Infection requires both xml and junit reports to work properly and fast.

So, it does not work with TeamCity format.


UPD (2021-05-02): pestphp/pest#291 Pest has fixed JUnit report, draft version of Pest Adapter in Infection works

@maks-rafalko
Copy link
Member

implemented and released with 0.23.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants