diff --git a/.env.default b/.env.default index df58ae0..3f38c21 100644 --- a/.env.default +++ b/.env.default @@ -60,7 +60,8 @@ export WPT_SSH_PRIVATE_KEY_BASE64="" # Whether to enable debug Mode. # # Enabling debug mode will output verbose logging and details about each part -# of the test runner. +# of the test runner. It also runs npm install and build commands with +# --loglevel=silly during preparation. # # 0 = Debug mode off # 1 = Debug mode on diff --git a/README.md b/README.md index 4302671..6e8b015 100644 --- a/README.md +++ b/README.md @@ -241,7 +241,7 @@ export WPT_SSH_OPTIONS="" export WPT_SSH_PRIVATE_KEY_BASE64="" # Output logging -# Use 'verbose' to increase verbosity +# Use 'verbose' to increase verbosity; also runs npm with --loglevel=silly export WPT_DEBUG="" # Certificate validation @@ -395,7 +395,7 @@ export WPT_SSH_PRIVATE_KEY_BASE64="" **Output logging** -Output logging. Use 'verbose' to increase verbosity. +Output logging. Use 'verbose' to increase verbosity. When set, the npm install and build commands during preparation also run with `--loglevel=silly`. ``` export WPT_DEBUG="" diff --git a/prepare.php b/prepare.php index 16d6d75..d503cfc 100644 --- a/prepare.php +++ b/prepare.php @@ -76,6 +76,13 @@ } +/* + * When debug mode is enabled, run npm at its most verbose logging level, so a + * hung or slow npm command shows what it is doing instead of sitting silent. + * The same debug mode adds verbosity to the rsync operations further down. + */ +$npm_verbosity = $runner_vars['WPT_DEBUG'] ? ' --loglevel=silly' : ''; + /* * Checkout and prepare wordpress-develop for testing. * @@ -96,7 +103,7 @@ 'git clone --depth=1 https://github.com/WordPress/wordpress-develop.git ' . escapeshellarg( $runner_vars['WPT_PREPARE_DIR'] ), // Change directory to the preparation directory, install npm dependencies, and build the project. - 'cd ' . escapeshellarg( $runner_vars['WPT_PREPARE_DIR'] ) . '; npm install && npm run build', + 'cd ' . escapeshellarg( $runner_vars['WPT_PREPARE_DIR'] ) . '; npm install' . $npm_verbosity . ' && npm run build' . $npm_verbosity, ) );