php-actions / phpunit

Run PHPUnit tests in Github Actions.
108 stars 24 forks source link

Fatal error : undefined method PHPUnit\TextUI\TestRunner::doRun() #11

Closed kadevland closed 4 years ago

kadevland commented 4 years ago

I will try you action for auto launch PHPunit but i have this error : Fatal error: Uncaught Error: Call to undefined method PHPUnit\TextUI\TestRunner::doRun() in /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php:204 Stack trace:

0 /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php(163): PHPUnit\TextUI\Command->run(Array, true)

1 /tmp/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()

2 {main}

thrown in /tmp/vendor/phpunit/phpunit/src/TextUI/Command.php on line 204

My Depot link: https://github.com/kadevland/simple-laravel-eloquent-uuid

g105b commented 4 years ago

Thanks for the report. I'll look into it and let you know what I find.

kadevland commented 4 years ago

Thx

g105b commented 4 years ago

Hi @kadevland , I noticed that your project was using PhpUnit v9, which the Github action hadn't been made compatible with. I'm just making and testing a new release (v2) for this action, which will fix your issue.

I will confirm here once it is tested, hopefully within the next few minutes.

neveldo commented 4 years ago

Hi @g105b , first of all, thanks for this useful GH action ! I encounter the same issue as @kadevland , hope the v2 will come :) Any help needed ?

g105b commented 4 years ago

Hi @neveldo thank you for your offer. Any help is appreciated.

I am skipping v2 release, and instead I will release v7, v8 and v9 concurrently to match the version of PHPUnit the version represents. This issue is here because the project uses PHPUnit v9, but this repo is only using PHPUnit v8 currently. There is no way to indicate this other than the version numbers of the actual action, which seem to make perfect sense for this.

Let me know what you think about the versioning idea. If you want to pick this up yourself, I'm happy to offer you advice either here or via email, but I am planning on getting round to this over the next few days, just super busy right now.

JC5 commented 4 years ago

I like that idea, and I'm curious about the progress. Matching the version to the PHPUnit version is a good idea.

neveldo commented 4 years ago

Hello,

I understand, having different versions of phpunit installed globally and locally can lead to weird issues. I also think following the versions of phpunit could be a good idea. And/Or maybe we could also add some kind of option to run the project local phpunit if it exists, instead of running it globally ? (If you have planned to work on it in the days to come, I think I will be useless as I'm still learning how do create github actions for now :p)

JC5 commented 4 years ago

Running a local phpunit would defeat the point of a separate action.

g105b commented 4 years ago

@neveldo yes I am planning on implementing these changes within the next few days. I don't have a huge amount of time right now for open source stuff, but I will find some time as soon as possible.

@JC5 you're right, running the local PHP Unit will defeat the point, but there is nothing from stopping someone from configuring this in their own action runner.

g105b commented 4 years ago

Hi @kadevland , @neveldo and @JC5 ,

Sorry for taking so long fixing this issue for you. I now have more time for open source, and I'm happy to say that I have managed to come to a good solution for this project.

Due to PHPUnit versions being incompatible with each other, you can now state the version of PHPUnit you wish to use your action yaml configuration.

I've put together an example project here, tested using PHPUnit v8 and v9: https://github.com/php-actions/example-phpunit

Let me know how you get on by replying here.

Cheers, Greg.

JC5 commented 4 years ago

Great work @g105b, thanks!