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

chore: add support for PHPUnit 8 #5252

Merged
merged 11 commits into from
May 13, 2022
Merged

chore: add support for PHPUnit 8 #5252

merged 11 commits into from
May 13, 2022

Conversation

bshaffer
Copy link
Contributor

@bshaffer bshaffer commented May 3, 2022

Adds PHPUnit 8 for testing!!
This will allow us to test on PHP 8.0 and 8.1.

Some important notes:

  • PHPUnit 9 was not used because it threw an unbelievable amount of warnings for phpunit-prophecy, and there is no polyfill available for that yet.
  • I used Yoast PHPUnit Polyfill to all composer.json to keep compatibility with PHPUnit 4 and 5.
    • PHPUnit 4 is needed for testing on PHP 5.5
    • PHPUnit 5 is needed for testing on PHP 5.6, 7.0, and 7.1
  • I removed the custom ResultPrinter class we were using for snippets test. This was causing function signature conflicts between PHPUnit versions, and it didn't seem worth the headache to make it compatible (which is non-trivial).
  • Once we drop support for PHP 7.3 and below, we can upgrade to PHPUnit 9.0 and remove all the polyfill logic. We will not be able to upgrade to PHPUnit 10, even if it's available by then, because it requires PHP 8.1+
  • Once this is merged, I will add tests for PHP 8.0 and 8.1 in a separate PR.

@bshaffer bshaffer marked this pull request as ready for review May 5, 2022 00:30
@bshaffer bshaffer requested review from a team as code owners May 5, 2022 00:30
@bshaffer bshaffer changed the title [DO NOT MERGE]: Add support for PHP 8 tests chore: add support for PHP 8 tests May 5, 2022
@bshaffer bshaffer changed the title chore: add support for PHP 8 tests chore: add support for PHPUnit 8 May 5, 2022
composer update --prefer-dist --no-interaction --no-suggest -d Bigtable/
composer config minimum-stability dev -d Bigtable/
composer config repositories.local path "../Core" -d Bigtable
composer require "google/cloud-core:*" -d Bigtable/
Copy link
Contributor Author

@bshaffer bshaffer May 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These additional lines make sure that the tests run the emulator using the current branch for the google/cloud-core dependency, instead of using a tagged version. This is required for this PR because we made changes in Core that these tests need to pass.

Core/src/Testing/GcTestListener.php Outdated Show resolved Hide resolved
Spanner/tests/System/PgReadTest.php Outdated Show resolved Hide resolved
Spanner/tests/System/PgWriteTest.php Show resolved Hide resolved
Spanner/tests/System/PgWriteTest.php Show resolved Hide resolved
Storage/tests/Unit/StreamWrapperTest.php Outdated Show resolved Hide resolved
composer.json Show resolved Hide resolved
@bshaffer bshaffer merged commit 8adcfea into main May 13, 2022
@bshaffer bshaffer deleted the add-php8-tests branch May 13, 2022 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants