Fix GitHub Actions workflow failures
- Add WP_PHPUNIT__DIR and WP_TESTS_DIR environment variables to PHPUnit workflow to fix 'WP_UnitTestCase not found' error - Increase WordPress Playground server timeout from 60s to 180s with better progress logging to fix timeout failures - Add conditional checks for SONAR_TOKEN and CODACY_PROJECT_TOKEN to gracefully skip analysis when tokens are not set - Properly handle server process lifecycle in Playground tests (capture PID, kill on completion)
This commit is contained in:
17
.github/workflows/playground-tests-fix.yml
vendored
17
.github/workflows/playground-tests-fix.yml
vendored
@@ -56,10 +56,21 @@ jobs:
|
||||
npx @wp-playground/cli server --blueprint playground/blueprint.json --port 8888 --login &
|
||||
SERVER_PID=$!
|
||||
|
||||
# Wait for WordPress Playground to be ready
|
||||
# Wait for WordPress Playground to be ready (increased timeout to 180s)
|
||||
echo "Waiting for WordPress Playground to be ready..."
|
||||
timeout 60 bash -c 'until curl -s http://localhost:8888; do sleep 2; done'
|
||||
echo "WordPress Playground is ready"
|
||||
TIMEOUT=180
|
||||
ELAPSED=0
|
||||
while ! curl -s http://localhost:8888 > /dev/null 2>&1; do
|
||||
if [ $ELAPSED -ge $TIMEOUT ]; then
|
||||
echo "Timeout waiting for WordPress Playground to start"
|
||||
kill $SERVER_PID || true
|
||||
exit 1
|
||||
fi
|
||||
echo "Waiting... ($ELAPSED/$TIMEOUT seconds)"
|
||||
sleep 5
|
||||
ELAPSED=$((ELAPSED + 5))
|
||||
done
|
||||
echo "WordPress Playground is ready after $ELAPSED seconds"
|
||||
|
||||
# Run Cypress tests against WordPress Playground
|
||||
echo "Running Cypress tests..."
|
||||
|
||||
Reference in New Issue
Block a user