WordPress / phpunit-test-runner

GNU General Public License v2.0
66 stars 63 forks source link

npm install gets stuck / hangs in reify:poly-fill-library #222

Open ronilaukkarinen opened 4 months ago

ronilaukkarinen commented 4 months ago

Describe the bug With the latest version the npm command gets stuck.

To Reproduce Steps to reproduce the behavior:

  1. Get latest version
  2. Run prepare.php
  3. See it getting stuck

Expected behavior The prepare script should be run through

Screenshots It's been like this for 24 hours now (those duplicate lines are due pressing enter key):

image

Additional context I'm sure this didn't happen before, but I don't know in which point it stopped working.

Node version: 20.10.0 (from the current package.json of wordpress-develop) Ubuntu 20.04.6 LTS

Also see PR #221.

ronilaukkarinen commented 4 months ago

I have circumvented the issue by just commenting out the line with npm install npm build to get the PHP tests out.

Not sure if the issue is with nvm, but reinstall or using other node versions won't work either.

The full script I'm using:

#!/bin/bash
# Load nvm and test runner env variables
source /home/wptestrunner/.nvm/nvm.sh
source /var/www/wp-test-runner/.env

# Get the correct node version from https://github.com/WordPress/wordpress-develop/blob/trunk/package.json engines section to a variable
mkdir -p $HOME/wordpress-develop
rm -f $HOME/wordpress-develop/package.json
wget -qO- https://raw.githubusercontent.com/WordPress/wordpress-develop/trunk/package.json > $HOME/wordpress-develop/package.json
WP_DEVELOP_NODE_VERSION=$(cat $HOME/wordpress-develop/package.json | grep -oP '(?<="node": ">=)(.*?)(?=")')
nvm install $WP_DEVELOP_NODE_VERSION

# Use the correct node version
nvm use $WP_DEVELOP_NODE_VERSION

# Make sure we are in the right place
cd /var/www/wp-test-runner

# Ensure we have the latest version
git pull

# Do complete cache clean
npm cache clean --force

# Do cleanup in case previous tests have failed
php /var/www/wp-test-runner/cleanup.php

# Prepare tests, bail if preparations fail
if php /var/www/wp-test-runner/prepare.php | grep -q "Success: Prepared environment"; then
  echo "Success: Prepared environment"
else
  echo ""
  exit
fi

# Actual tests do not have clear output to test against
php /var/www/wp-test-runner/test.php

# Send test results, bail upload does not succeed
if php /var/www/wp-test-runner/report.php | grep -q "Results successfully uploaded"; then
  echo "Results successfully uploaded"
else
  echo ""
  exit
fi

# Cleanup do not have clear output to test against
php /var/www/wp-test-runner/cleanup.php
pfefferle commented 3 months ago

Can you try it with these changes? https://github.com/WordPress/phpunit-test-runner/pull/225