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

Workflows: Prime a WP install and skip install for the actual test run. #256

Merged

Conversation

costdev
Copy link
Contributor

@costdev costdev commented Jan 8, 2025

Pull Request

What changed?

The PHPUnit test workflow now performs a dummy run to prime the WordPress install for tests.

When this completes, the actual test run is performed, with the WP_TESTS_SKIP_INSTALL environment variable set to 1.

Why did it change?

Since many of the tests must run in separate processes, the WordPress installation occurs in each process. This is an unnecessary delay. By priming the install and explicitly disabling the install attempts in the actual runs, this delay is removed.

Also, it's nice to have nice things.

Did you fix any specific issues?

Fixes #257

CERTIFICATION

By opening this pull request, I do agree to abide by the Code of Conduct and be bound by the terms of the Contribution Guidelines in effect on the date and time of my contribution as proven by the revision information in GitHub.

@costdev costdev marked this pull request as ready for review January 8, 2025 23:40
@costdev
Copy link
Contributor Author

costdev commented Jan 8, 2025

Previously: 1m 53s
With this PR: 1m 4s (though other runs have shown sometimes faster than this)

This equates to a workflow run time reduction of ~43%.

@costdev costdev merged commit e91ebec into aspirepress:main Jan 9, 2025
5 checks passed
@costdev costdev deleted the workflows/speed-up-phpunit-test-runs branch January 9, 2025 00:37
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.

Workflows: Speed up PHPUnit tests
1 participant