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

PHPUnit: Fix slow tests #1087

Merged
merged 8 commits into from
Dec 18, 2024
Merged

PHPUnit: Fix slow tests #1087

merged 8 commits into from
Dec 18, 2024

Conversation

obenland
Copy link
Member

@obenland obenland commented Dec 17, 2024

Takes test execution from 7.8s to ~3s.

class-test-followers.php needs a keen eye to see if the AI has inadvertently removed an implicit test that we should keep.

Once we drop support for PHP 7.0, the listener can be enabled by default.

Proposed changes:

  • Adds a timing listener to tests
  • Adds http request mocks and breaks up tests to make them faster.

Other information:

  • Have you written new tests for your changes, if applicable?

@obenland obenland added the Skip Changelog Disables the "Changelog Updated" action for PRs where changelog entries are not necessary. label Dec 17, 2024
@obenland obenland requested a review from a team December 17, 2024 19:34
@obenland obenland self-assigned this Dec 17, 2024
@obenland obenland force-pushed the fix/slow-tests branch 2 times, most recently from 7546ab0 to 4309da3 Compare December 17, 2024 20:14
@obenland obenland changed the title Tests: Fix slow tests PHPUnit: Fix slow tests Dec 17, 2024
@pfefferle
Copy link
Member

I am Fine with catching up with WordPress and require 7.2!

pfefferle
pfefferle previously approved these changes Dec 18, 2024
Copy link
Member

@pfefferle pfefferle left a comment

Choose a reason for hiding this comment

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

Maybe we can use JSON files in a future PR... something like sanitize_title( $host ).json. It would be easier to add new platforms or to update the existing ones, this way.

@obenland obenland merged commit 6a7de00 into trunk Dec 18, 2024
24 checks passed
@obenland obenland deleted the fix/slow-tests branch December 18, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Disables the "Changelog Updated" action for PRs where changelog entries are not necessary.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants