Tests: Use different port numbers between scenarios#99
Tests: Use different port numbers between scenarios#99swissspidy wants to merge 1 commit intomainfrom
Conversation
|
Hello! 👋 Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project. Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. Here are some useful Composer commands to get you started:
To run a single Behat test, you can use the following command: # Run all tests in a single file
composer behat features/some-feature.feature
# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123You can find a list of all available Behat steps in our handbook. |
There was a problem hiding this comment.
Code Review
This pull request updates the hardcoded port from 8182 to 8185 in the server feature test to resolve a conflict. The review feedback suggests that using dynamic port allocation instead of hardcoded values would further improve test robustness and prevent future flakiness.
| And I launch in the background `wp server --host=localhost --port=8185` | ||
|
|
||
| When I run `curl -sS http://localhost:8182/wp-login.php` | ||
| When I run `curl -sS http://localhost:8185/wp-login.php` |
There was a problem hiding this comment.
While this change fixes an immediate port conflict, using hardcoded ports in tests can lead to test flakiness if the port is already in use on the execution environment. To improve robustness, consider having the test dynamically allocate an available port. This would prevent future conflicts and make the test suite more reliable.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
No description provided.