eloquent-power-joins icon indicating copy to clipboard operation
eloquent-power-joins copied to clipboard

(ci) test with lowest dependency required version

Open Sysix opened this issue 1 year ago • 7 comments
trafficstars

At the moment we install all our dependencies with the highest minor & patch number.
Because this project support all major versions from the beginning (X.0) we should also test these specific versions too.

There is a composer command which will help us: --prefer-lowest From the composer docs it suggest to also include --prefer-stable

Sysix avatar Feb 13 '24 19:02 Sysix

This makes sense, thanks @Sysix. But the tests are failing. I think it's because of the PHPUnit dependency, but not quite sure.

luisdalmolin avatar Feb 15 '24 11:02 luisdalmolin

PHP 8 Support is only available for phpunit 9.3: https://github.com/sebastianbergmann/phpunit/milestone/38?closed=1

Also testbench support laravel 8 at version 6.*: https://packages.tools/testbench.html

EDIT: when its still not working, we need to drop the phpunit 9 support. Should not be that much of a problem 🤞

Sysix avatar Feb 15 '24 21:02 Sysix

PHPUnit 10 supports only PHP8.1. PHPUnit 9.5 removed the deprecation warning

Then another wierd Bug was happening with testbench < 6.24:

There was 1 failure:

  1. Kirschbaum\PowerJoins\Tests\JoinRelationshipTest::test_has_one_of_many Failed asserting that 'select "posts".*, "comments"."body", max("votes") as "votes", "comments"."post_id" from "posts" inner join "comments" on "comments"."post_id" = "posts"."id" where "posts"."deleted_at" is null limit 1' contains "max("comments"."votes") as "votes_aggregate"".

/var/www/html/tests/JoinRelationshipTest.php:765

When requiring testbench 6.24 this bug is fixed. Don't know why :/

EDIT: I looked which version is tested for laravel. The tests require laravel 8.75.0 so we should also reflect that.

Sysix avatar Feb 20 '24 19:02 Sysix

the CI overwrote our requirements. Updated the github workflow too :)

Sysix avatar Feb 21 '24 23:02 Sysix

Still erroring. I'm not opposed on dropping support for outdated Laravel/PHP versions, if that helps

luisdalmolin avatar Feb 29 '24 15:02 luisdalmolin

I forgot one line to update.

Sysix avatar Mar 08 '24 09:03 Sysix

Hey @Sysix, we updated this based on the latest master, but it appears to be broken as the testbench versions are now not being passed through to that installation command. It would be great if you had any ideas about what is wrong!

danharrin avatar Oct 02 '24 20:10 danharrin

Lots of changes were made to the CI file so I'm closing this one.

luisdalmolin avatar Feb 12 '25 11:02 luisdalmolin