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

Drupal 11 support for ddev phpunit #65

Closed
mscieszka opened this issue Jun 20, 2024 · 2 comments
Closed

Drupal 11 support for ddev phpunit #65

mscieszka opened this issue Jun 20, 2024 · 2 comments

Comments

@mscieszka
Copy link
Contributor

mscieszka commented Jun 20, 2024

I have installed Drupal 11.0-dev to investigate issues with the phpunit (next major) pipeline in https://gitlab.com/drupalspoons/devel/-/jobs/7146821758. Pipeline from gitlab templates invokes phpunit differently than ddev-drupal-contrib:

sudo -u www-data -E vendor/bin/phpunit  --bootstrap /builds/drupalspoons/devel/web/core/tests/bootstrap.php /builds/drupalspoons/devel/web/modules/custom/devel --log-junit /builds/drupalspoons/devel/junit.xml  

When I try to run phpunit in my local project using ddev phpunit, I get the following error:
obraz

The PHPUnit 10.5 documentation seems to indicate that there is no --printer flag.

In .ddev/commands/phpunit there is the following code:
phpunit --printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php --testdox $DDEV_DOCROOT/modules/custom "$@"

I have noticed that HtmlOutputPrinter is present in Drupal 10.3, but has been moved/removed/modified in 11.x.

After some digging I have found Drupal\TestTools\Extension\HtmlLogging\HtmlOutputLogger that might be helpful.

However, simply removing --printer="\Drupal\TestTools\Extension\HtmlLogging\HtmlOutputLogger" part of the command so that only phpunit --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php --testdox $DDEV_DOCROOT/modules/custom "$@" remains, allows phpunit to run properly (still, I am not sure if output is formatted/handled as expected):
obraz

@mscieszka mscieszka changed the title Support ddev phpunit for Drupal 11 Drupal 11 support for ddev phpunit Jun 20, 2024
@weitzman
Copy link
Collaborator

FYI We removed --testdox recently in #63.

We do want to keep the browser output so lets see how to fix this properly.

@weitzman
Copy link
Collaborator

weitzman commented Aug 5, 2024

I removed --printer in #70. I think the debug files are saved just by the fact that we set BROWSERTEST_OUTPUT_DIRECTORY. We can add back the links if we want. See https://www.drupal.org/project/drupal/issues/3452519

@weitzman weitzman closed this as completed Aug 5, 2024
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

No branches or pull requests

2 participants