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

Fix php since wp-env changed #37

Merged
merged 1 commit into from
May 22, 2023
Merged

Fix php since wp-env changed #37

merged 1 commit into from
May 22, 2023

Conversation

johnstonphilip
Copy link
Member

@johnstonphilip johnstonphilip commented May 19, 2023

In the wp-env project (inside Gutenberg repo), the PHPUnit and Composer packages were removed.

This resulted in PHPunit tests failing to run using wpp-scripts with the message:
The 'phpunit' container has been removed. Please use 'wp-env run tests-cli --env-cwd=wp-content/path/to/plugin phpunit' instead.

Note:

This PR changes that over. I haven't had a chance to figure out how to get multisite to work yet, so I have removed that for now.

This may require changes to a few things in your tests suite. See companion PR in pattern-manager for more details on changes required there.

@kienstra
Copy link
Collaborator

I haven't had a chance to figure out how to get multisite to work yet, so I have removed that for now.

It's probably fine if we don't support multisite, and just add it when we need it.

Copy link
Collaborator

@kienstra kienstra left a comment

Choose a reason for hiding this comment

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

Hi @johnstonphilip,
Thanks a lot for fixing this.

Now, npm run test:phpunit is passing in my local.

@@ -8,3 +8,4 @@ build
/phpcs.xml
/.wp-env.json
/.wp-env.json.bak
.phpunit.result.cache
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good idea

else
npx -p @wordpress/env wp-env run phpunit "phpunit -c /var/www/html/wp-content/wpps-scripts/phpunit.xml.dist /var/www/html/wp-content/plugins/$plugindirname"
fi
npx -p @wordpress/env wp-env run --env-cwd=\"wp-content/wpps-scripts\" tests-wordpress phpunit -c ./phpunit.xml.dist /var/www/html/wp-content/plugins/$plugindirname
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice simplification, we don't run multisite tests anyway

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