Skip to content

Tests: Use different port numbers between scenarios#99

Draft
swissspidy wants to merge 1 commit intomainfrom
fix/tests-compat
Draft

Tests: Use different port numbers between scenarios#99
swissspidy wants to merge 1 commit intomainfrom
fix/tests-compat

Conversation

@swissspidy
Copy link
Copy Markdown
Member

No description provided.

@swissspidy swissspidy added the scope:testing Related to testing label Mar 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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:

  • composer install: Install dependencies.
  • composer test: Run the full test suite.
  • composer phpcs: Check for code style violations.
  • composer phpcbf: Automatically fix code style violations.
  • composer phpunit: Run unit tests.
  • composer behat: Run behavior-driven tests.

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:123

You can find a list of all available Behat steps in our handbook.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +35 to +37
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`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant