-
Notifications
You must be signed in to change notification settings - Fork 804
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
Dev: Only one WordPress #41057
base: trunk
Are you sure you want to change the base?
Dev: Only one WordPress #41057
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave it a try, it seems to test well. Let's give it a try!
I have a few remarks below:
I think you'll need to update packages/account-protection
as well.
What do you think about updating the docs in docs/automated-testing.md
and docs/monorepo.md
to explain that setup?
You should be able to remove this now?
/vendor/automattic/wordbless/** production-exclude |
I think you may have to update the generate command so folks do not set up WorDBless again in new packages:
jetpack/tools/cli/commands/generate.js
Lines 715 to 722 in bb536db
if ( answers.wordbless ) { | |
composerJson.scripts[ 'post-install-cmd' ] = 'WorDBless\\Composer\\InstallDropin::copy'; | |
composerJson.scripts[ 'post-update-cmd' ] = 'WorDBless\\Composer\\InstallDropin::copy'; | |
composerJson[ 'require-dev' ][ 'automattic/wordbless' ] = 'dev-master'; | |
composerJson.config = composerJson.config || {}; | |
composerJson.config[ 'allow-plugins' ] = composerJson.config[ 'allow-plugins' ] || {}; | |
composerJson.config[ 'allow-plugins' ][ 'roots/wordpress-core-installer' ] = true; | |
} |
@jeherve I believe I resolved or explained all of the items in your feedback. |
Code Coverage SummaryCoverage changed in 2 files.
1 file are newly covered.
|
// Only include the src directory | ||
$options['directory_list'][] = $wordbless_path . '/src'; | ||
// Exclude from analysis | ||
$options['exclude_analysis_directory_list'][] = $wordbless_path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this works, IMO it would be a little cleaner to have an array that works like $extra_stubs
, which gets array_merge
d into the two config entries below, instead of changing the $options
directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm down for fixing this in a follow-up. I'm itchy to get it in and iterate on it vs holding up the PR too much longer.
Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>
…attic/jetpack into try/one-wordpress-to-rule-them-all
For unit testing, we often use WorDBless, a variant of WordPress that does not require database setup. Except, we include it a lot so there are a lot of copies of WordPress within the repo when fully installed.
Before and after the changes proposed below (conducted in clean directories on my M1 with composer's cache cleared)
Before:
1st run of
jetpack install --all
: Between 2m 57s and 3m 17s2nd run: 56s
Size: (du of monorepo with du of .git subtracted): 5.1 GB
After:
1st run: Between 1m 20s and 1m 52s
2nd run: 55s
Size: 2.7 GB
Proposed changes:
test-environment
package to serve as the WorDBless loader for monorepo projects.jetpack install --all, -r
will cover it.In short, this changes the packages consumed by individual projects to use the internal test-environment. This ensure it is easy to modify all in the future and required little change to each individual package.
The test-environment loads a class that loads the test-php-env autoloader and loads WorDBless.
The test-php-env quasi-package does a singular install of WorDBless.
Other solution investigated was having the
test-environment
package directly require WorDBless, but that meant it would be re-installed every timetest-environment
was installed. No gain (at least) to install time, but it would have ended up with only one copy of WP.Other information:
Jetpack product discussion
None yet.
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
jetpack install -r
(at least) andjetpack install
a package that uses worDBLess, likepackages/admin-ui
jetpack test phh packages/admin-ui
Does it still run the test successfully?