wp-env fix exec command in CI#50411
Merged
Merged
Conversation
2 tasks
|
Size Change: 0 B Total Size: 1.37 MB ℹ️ View Unchanged
|
Use -T instead of --no-TTY. The latter doesn't work. Fix unit test that was failing on trunk.
noahtallen
commented
May 6, 2023
|
|
||
| $script = $wp_scripts->query( 'gutenberg-dummy-script', 'registered' ); | ||
| $this->assertEquals( array( 'dependency', 'wp-i18n' ), $script->deps ); | ||
| $this->assertEquals( array( 'dependency' ), $script->deps ); |
Member
Author
There was a problem hiding this comment.
Note: in #49994, the function which injects wp-i18n was changed. According to @gziolo, this is expected:
I fixed [too many scripts loading] with 0cdab08. I'm not sure why that code was enforcing including wp-i18n as a dependency to all scripts coming from the Gutenberg plugin 🤷🏻
I replicated the logic from WordPress core that resolves the issue and ensures that translations still work where applicable
Since the phpunit tests were not running correctly, it makes sense that the phpunit tests were not updated in that PR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Phpunit tests are not running anything in Github actions currently. This makes them work again. This was ultimately caused by #50007, so PHPunit hasn't been running on trunk or in branches for about a week. Thankfully, not many failures were introduced!
The issue was that wp-env would say phpunit was executing, but nothing would happen, and nothing would be printed to the terminal. Ultimately, Docker has very poor documentation around this issue (--no-TTY is supposed to work, but doesn't, and docker-compose run prints a help message, but docker-compose exec doesn't.) Plus, we don't have anything making sure that phpunit tests are being executed!
Essentially,
--no-TTYisn't actually a flag that docker-compose accepts. When usingruninstead ofexec, you get a help message which says that only-Tis accepted. I guessed this was also the case for exec, but for some reason no help message was printed to indicate this. Changing that to-Twhen we aren't running with a TTY (like in CI), it started running phpunit again.I also fixed the failing trunk test.
Follow-up
Testing Instructions
PHPunit should pass
Testing Instructions for Keyboard
Screenshots or screencast