Skip to content

Build/Test Tools: Improve dev environment's CLI in speed, non-interactive usage, and argument handling #8969

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

Closed
wants to merge 15 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove extraneous wp from GHA workflow
  • Loading branch information
westonruter committed Jun 13, 2025

Verified

This commit was signed with the committer’s verified signature. The key has expired.
westonruter Weston Ruter
commit 8f2af97e783edbb09513afb598ce5fdc51d3890f
Original file line number Diff line number Diff line change
@@ -155,7 +155,7 @@ jobs:
run: npm run env:restart

- name: Test a CLI command
run: npm run env:cli wp option get siteurl
run: npm run env:cli option get siteurl
Copy link
Member Author

Choose a reason for hiding this comment

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

The wp is removed here because previously the entrypoint would inject it if it was missing: https://github.com/WordPress/wpdev-docker-images/blob/becc6740684d6ff6414d6539df040633b5ac5794/entrypoint/entrypoint-cli.sh#L16-L17

With this PR, the wp is always assumed.

Copy link
Member

Choose a reason for hiding this comment

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

Since this is technically a breaking change, I searched github for npm run env:cli wp and there is only one reference which seems to be from a fork of a demo rather than actual production code, but it still might be worth a PR there after this lands and a quick note in the core room so folks are aware. I don't think it needs a dev note though since this isn't a public API.

Copy link
Member Author

Choose a reason for hiding this comment

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


- name: Test logs command
run: npm run env:logs

Unchanged files with check annotations Beta

test.beforeEach( async () => {
wpConfigOriginal = readFileSync( wpConfig, 'utf-8' );
// Changing the table prefix tricks WP into new install mode.
writeFileSync(

Check failure on line 24 in tests/e2e/specs/install.test.js

GitHub Actions / Test with SCRIPT_DEBUG enabled / Run E2E tests

[chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials

1) [chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: EACCES: permission denied, open '/home/runner/work/wordpress-develop/wordpress-develop/wp-config.php' 22 | wpConfigOriginal = readFileSync( wpConfig, 'utf-8' ); 23 | // Changing the table prefix tricks WP into new install mode. > 24 | writeFileSync( | ^ 25 | wpConfig, 26 | wpConfigOriginal.replace( `$table_prefix = 'wp_';`, `$table_prefix = 'wp_e2e_';` ) 27 | ); at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/install.test.js:24:16

Check failure on line 24 in tests/e2e/specs/install.test.js

GitHub Actions / Test with SCRIPT_DEBUG enabled / Run E2E tests

[chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials

1) [chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: EACCES: permission denied, open '/home/runner/work/wordpress-develop/wordpress-develop/wp-config.php' 22 | wpConfigOriginal = readFileSync( wpConfig, 'utf-8' ); 23 | // Changing the table prefix tricks WP into new install mode. > 24 | writeFileSync( | ^ 25 | wpConfig, 26 | wpConfigOriginal.replace( `$table_prefix = 'wp_';`, `$table_prefix = 'wp_e2e_';` ) 27 | ); at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/install.test.js:24:16

Check failure on line 24 in tests/e2e/specs/install.test.js

GitHub Actions / Test with SCRIPT_DEBUG enabled / Run E2E tests

[chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials

1) [chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials Error: EACCES: permission denied, open '/home/runner/work/wordpress-develop/wordpress-develop/wp-config.php' 22 | wpConfigOriginal = readFileSync( wpConfig, 'utf-8' ); 23 | // Changing the table prefix tricks WP into new install mode. > 24 | writeFileSync( | ^ 25 | wpConfig, 26 | wpConfigOriginal.replace( `$table_prefix = 'wp_';`, `$table_prefix = 'wp_e2e_';` ) 27 | ); at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/install.test.js:24:16

Check failure on line 24 in tests/e2e/specs/install.test.js

GitHub Actions / Test with SCRIPT_DEBUG disabled / Run E2E tests

[chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials

1) [chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: EACCES: permission denied, open '/home/runner/work/wordpress-develop/wordpress-develop/wp-config.php' 22 | wpConfigOriginal = readFileSync( wpConfig, 'utf-8' ); 23 | // Changing the table prefix tricks WP into new install mode. > 24 | writeFileSync( | ^ 25 | wpConfig, 26 | wpConfigOriginal.replace( `$table_prefix = 'wp_';`, `$table_prefix = 'wp_e2e_';` ) 27 | ); at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/install.test.js:24:16

Check failure on line 24 in tests/e2e/specs/install.test.js

GitHub Actions / Test with SCRIPT_DEBUG disabled / Run E2E tests

[chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials

1) [chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: EACCES: permission denied, open '/home/runner/work/wordpress-develop/wordpress-develop/wp-config.php' 22 | wpConfigOriginal = readFileSync( wpConfig, 'utf-8' ); 23 | // Changing the table prefix tricks WP into new install mode. > 24 | writeFileSync( | ^ 25 | wpConfig, 26 | wpConfigOriginal.replace( `$table_prefix = 'wp_';`, `$table_prefix = 'wp_e2e_';` ) 27 | ); at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/install.test.js:24:16

Check failure on line 24 in tests/e2e/specs/install.test.js

GitHub Actions / Test with SCRIPT_DEBUG disabled / Run E2E tests

[chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials

1) [chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials Error: EACCES: permission denied, open '/home/runner/work/wordpress-develop/wordpress-develop/wp-config.php' 22 | wpConfigOriginal = readFileSync( wpConfig, 'utf-8' ); 23 | // Changing the table prefix tricks WP into new install mode. > 24 | writeFileSync( | ^ 25 | wpConfig, 26 | wpConfigOriginal.replace( `$table_prefix = 'wp_';`, `$table_prefix = 'wp_e2e_';` ) 27 | ); at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/install.test.js:24:16
wpConfig,
wpConfigOriginal.replace( `$table_prefix = 'wp_';`, `$table_prefix = 'wp_e2e_';` )
);
} );
test.afterEach( async () => {
writeFileSync( wpConfig, wpConfigOriginal );

Check failure on line 31 in tests/e2e/specs/install.test.js

GitHub Actions / Test with SCRIPT_DEBUG enabled / Run E2E tests

[chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials

1) [chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: EACCES: permission denied, open '/home/runner/work/wordpress-develop/wordpress-develop/wp-config.php' 29 | 30 | test.afterEach( async () => { > 31 | writeFileSync( wpConfig, wpConfigOriginal ); | ^ 32 | } ); 33 | 34 | test( 'should install WordPress with pre-existing database credentials', async ( { page } ) => { at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/install.test.js:31:16

Check failure on line 31 in tests/e2e/specs/install.test.js

GitHub Actions / Test with SCRIPT_DEBUG enabled / Run E2E tests

[chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials

1) [chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: EACCES: permission denied, open '/home/runner/work/wordpress-develop/wordpress-develop/wp-config.php' 29 | 30 | test.afterEach( async () => { > 31 | writeFileSync( wpConfig, wpConfigOriginal ); | ^ 32 | } ); 33 | 34 | test( 'should install WordPress with pre-existing database credentials', async ( { page } ) => { at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/install.test.js:31:16

Check failure on line 31 in tests/e2e/specs/install.test.js

GitHub Actions / Test with SCRIPT_DEBUG enabled / Run E2E tests

[chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials

1) [chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials Error: EACCES: permission denied, open '/home/runner/work/wordpress-develop/wordpress-develop/wp-config.php' 29 | 30 | test.afterEach( async () => { > 31 | writeFileSync( wpConfig, wpConfigOriginal ); | ^ 32 | } ); 33 | 34 | test( 'should install WordPress with pre-existing database credentials', async ( { page } ) => { at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/install.test.js:31:16

Check failure on line 31 in tests/e2e/specs/install.test.js

GitHub Actions / Test with SCRIPT_DEBUG disabled / Run E2E tests

[chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials

1) [chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: EACCES: permission denied, open '/home/runner/work/wordpress-develop/wordpress-develop/wp-config.php' 29 | 30 | test.afterEach( async () => { > 31 | writeFileSync( wpConfig, wpConfigOriginal ); | ^ 32 | } ); 33 | 34 | test( 'should install WordPress with pre-existing database credentials', async ( { page } ) => { at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/install.test.js:31:16

Check failure on line 31 in tests/e2e/specs/install.test.js

GitHub Actions / Test with SCRIPT_DEBUG disabled / Run E2E tests

[chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials

1) [chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: EACCES: permission denied, open '/home/runner/work/wordpress-develop/wordpress-develop/wp-config.php' 29 | 30 | test.afterEach( async () => { > 31 | writeFileSync( wpConfig, wpConfigOriginal ); | ^ 32 | } ); 33 | 34 | test( 'should install WordPress with pre-existing database credentials', async ( { page } ) => { at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/install.test.js:31:16

Check failure on line 31 in tests/e2e/specs/install.test.js

GitHub Actions / Test with SCRIPT_DEBUG disabled / Run E2E tests

[chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials

1) [chromium] › tests/e2e/specs/install.test.js:34:6 › WordPress installation process › should install WordPress with pre-existing database credentials Error: EACCES: permission denied, open '/home/runner/work/wordpress-develop/wordpress-develop/wp-config.php' 29 | 30 | test.afterEach( async () => { > 31 | writeFileSync( wpConfig, wpConfigOriginal ); | ^ 32 | } ); 33 | 34 | test( 'should install WordPress with pre-existing database credentials', async ( { page } ) => { at /home/runner/work/wordpress-develop/wordpress-develop/tests/e2e/specs/install.test.js:31:16
} );
test( 'should install WordPress with pre-existing database credentials', async ( { page } ) => {