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

[dx] require >= PHPUnit 9.6, update phpunit schema, deprecate skipOnSymfony7() #1425

Merged
merged 12 commits into from
Feb 1, 2024

Conversation

jrushlow
Copy link
Collaborator

@jrushlow jrushlow commented Jan 26, 2024

  • deprecates MakerTestDetails::skipOnSymfony7() methods that were meant to be used internally.

  • add ability to skip tests locally (e.g. mercure tests can be skipped by setting MAKER_SKIP_MERCURE_TEST to true in phpunit.xml. Previously that var had to be set in the $_SERVER super global.) This plays into Windows tests on GitHub actions.

  • fix outdated / deprecated phpunit.xml.dist schema / attributes

  • require PHPUnit 9.6+ in tests (Only have to worry about 1 phpunit.xml schema. )

  • adds a MakerTestDetails::skipTest() method & logic to replace the now deprecated skipOnSymfony7() methods. Ideally, we'll keep the new method for future use even if we're not using it now. skipTest() is marked @internal for the time being.

@jrushlow jrushlow added Minor Minor Enhancement Feature New Feature and removed Minor Minor Enhancement labels Jan 26, 2024
@jrushlow jrushlow changed the title [ci] require >= PHPUnit 9.6 [dx] require >= PHPUnit 9.6 Jan 26, 2024
@jrushlow jrushlow changed the title [dx] require >= PHPUnit 9.6 [dx] require >= PHPUnit 9.6, update phpunit schema, deprecate skipOnSymfony7() Jan 26, 2024
// @legacy - MakeEntity uses ux-turbo-mercure (archived), it needs to use ux-turbo (mercure built in) for Symfony 7.0
if ('7.0.x-dev' === $_SERVER['SYMFONY_VERSION']) {
return $this->createMakerTest()
->skipTest('symfony/ux-turbo-mercure is not supported on Symfony 7.')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Chicken or the egg... MakeEntity needs to be refactored to use ux-turbo and at first glance doesn't appear to be a "1 for 1" swap with ux-turbo-mercure. To keep the entire test suite from blowing up due to a deprecation - this skip conditional was moved here for now.

Copy link
Member

Choose a reason for hiding this comment

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

Ok for now for me

@jrushlow jrushlow added the Status: Needs Review Needs to be reviewed label Jan 26, 2024
composer.json Outdated
@@ -30,6 +30,7 @@
"composer/semver": "^3.0",
"doctrine/doctrine-bundle": "^2.5.0",
"doctrine/orm": "^2.10.0",
"phpunit/phpunit": "^9.6",
Copy link
Member

Choose a reason for hiding this comment

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

Does phpunit-bridge read / respect this? We run vendor/bin/simple-phpunit, which downloads its own phpunit. Does this signal to download 9.6? I thought the version was done with an env var.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch! added the SYMFONY_PHPUNIT_VERSION with 9.6 to phpunit.xml.dist instead.... simple-phpunit picks up on that locally and on ci when doing the install.

// @legacy - MakeEntity uses ux-turbo-mercure (archived), it needs to use ux-turbo (mercure built in) for Symfony 7.0
if ('7.0.x-dev' === $_SERVER['SYMFONY_VERSION']) {
return $this->createMakerTest()
->skipTest('symfony/ux-turbo-mercure is not supported on Symfony 7.')
Copy link
Member

Choose a reason for hiding this comment

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

Ok for now for me

@jrushlow jrushlow added Status: Reviewed Has been reviewed by a maintainer Related Tests Pass and removed Status: Needs Review Needs to be reviewed labels Feb 1, 2024
@jrushlow jrushlow merged commit 3f0d95a into symfony:main Feb 1, 2024
5 of 6 checks passed
@jrushlow jrushlow deleted the bug/phpunit branch February 1, 2024 17:05
@jrushlow jrushlow mentioned this pull request Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature Related Tests Pass Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants