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

MNT Update phpunit xml file for phpunit 11 #11407

Merged

Conversation

emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Sep 26, 2024

Issue #11406

Needs silverstripe/gha-run-tests#40 merged and tagged first

phpunit xml file needs to be different for phpunit 11. Notably <exclude> can no longer be in <directory>

I tried this novel approach to mimic exclude, though it doesn't work

      <directory>tests/php</directory>
      <!-- Exclude ORM tests from core suite by requiring PHP version 99 or above -->
      <directory phpVersion="99.0.0" phpVersionOperator=">=">tests/php/ORM</directory>

Since there's no way to actually exclude a subdirectory anymore via the xml file, I think we need to filter the testsuites in github actions. The other option is to move ORM tests into a totally different location, though I don't want to do that

I also ran the --migrate-configuration flag when running phpunit 11 to automatically fix another xml issue. Note that when running this it adds a cacheDirectory=".phpunit.cache" attribute which we do not want as this causes a cache dir in the root folder to be added which we don't want, so delete this attribute if running this on other modules. The xml file is valid without the cacheDirectory attribute

@emteknetnz emteknetnz force-pushed the pulls/6/phpunit-xml branch 2 times, most recently from ed19ae8 to d045628 Compare September 26, 2024 06:41
@emteknetnz emteknetnz marked this pull request as ready for review September 26, 2024 06:57
@emteknetnz emteknetnz changed the title MNT Update phpunit.xml MNT Update phpunit xml file for phpunit 11 Sep 26, 2024
phpunit.xml.dist Outdated Show resolved Hide resolved
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

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

LGTM. CI failures are unrelated, I think. They'll be sorted out as part of silverstripe/.github#313

@GuySartorelli GuySartorelli merged commit afdd95e into silverstripe:6 Sep 26, 2024
6 of 10 checks passed
@GuySartorelli GuySartorelli deleted the pulls/6/phpunit-xml branch September 26, 2024 22:50
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