Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a6c5cde
Attempt to install Docker.
twstokes Feb 24, 2026
731a527
Don't install Docker because it's reporting that it's already installed.
twstokes Feb 24, 2026
31eeece
ci: Add Docker diagnostic logging to E2E step on macOS agent
dcalhoun Feb 25, 2026
21678e5
ci: Install Playwright system deps on Linux agent before E2E tests
dcalhoun Feb 25, 2026
7404e3b
ci: Add DEBIAN_FRONTEND=noninteractive to Playwright deps install
dcalhoun Feb 25, 2026
092a76e
ci: Add diagnostics for default Linux queue capabilities
dcalhoun Feb 25, 2026
1bd4376
ci: Run Playwright E2E tests inside Docker container
dcalhoun Feb 25, 2026
5658227
ci: Use --userns=host to allow --network host in Playwright container
dcalhoun Feb 25, 2026
65f45aa
ci: Add wp-env diagnostics to debug editor settings 404
dcalhoun Feb 26, 2026
56a45fa
ci: Debug wp-env REST API permalink issue
dcalhoun Feb 26, 2026
a131492
fix: Write .htaccess directly in wp-env for pretty permalinks
dcalhoun Feb 26, 2026
faf2ea3
fix: Use wp eval to write .htaccess with correct permissions
dcalhoun Feb 26, 2026
a4b6dc2
fix: Use docker exec as root to write .htaccess
dcalhoun Feb 26, 2026
05cd70b
fix: Find wp-env container by published port instead of image name
dcalhoun Feb 26, 2026
d80dc65
test: Add network request logging to image upload test
dcalhoun Feb 26, 2026
154faa3
ci: Dump WordPress debug log and uploads permissions after E2E tests
dcalhoun Feb 26, 2026
92a77f2
ci: Prevent script abort so WordPress debug log is captured
dcalhoun Feb 26, 2026
296b388
ci: Fix root-owned files left by Playwright container
dcalhoun Feb 26, 2026
d6b89b5
ci: Capture wp-env container ID before Playwright overwrites node_mod…
dcalhoun Feb 27, 2026
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
34 changes: 32 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,38 @@ steps:
tar -xzf dist.tar.gz
echo "--- :docker: Starting wp-env"
make wp-env-start
echo "--- :performing_arts: Running E2E tests"
make test-e2e
WP_CONTAINER=$(docker ps -qf "publish=8888" | head -1)
echo "--- :performing_arts: Running E2E tests in Playwright container"
E2E_EXIT=0
docker run --rm \
--userns=host \
--network host \
-v "$(pwd):/work" \
-w /work \
-e CI=true \
mcr.microsoft.com/playwright:v1.58.2-noble \
bash -c "npm ci && npx playwright install chromium && npx playwright test" \
|| E2E_EXIT=$?
echo "--- :broom: Fixing ownership of root-owned files"
docker run --rm \
--userns=host \
-v "$(pwd):/work" \
-w /work \
mcr.microsoft.com/playwright:v1.58.2-noble \
chown -R "$(id -u):$(id -g)" /work
echo "--- :wordpress: WordPress debug log"
if [ -n "$WP_CONTAINER" ]; then
docker exec "$WP_CONTAINER" cat /var/www/html/wp-content/debug.log 2>/dev/null || echo "(no debug.log found)"
echo "--- :file_folder: Uploads directory permissions"
docker exec "$WP_CONTAINER" ls -la /var/www/html/wp-content/uploads/ 2>/dev/null || echo "(no uploads directory)"
echo "--- :whale: WordPress container status"
docker inspect --format='{{.State.Status}}' "$WP_CONTAINER" 2>/dev/null || echo "(container gone)"
else
echo "(WordPress container not found before tests)"
fi
exit $E2E_EXIT
agents:
queue: default
plugins: *plugins

- label: ':android: Publish Android Library'
Expand Down
26 changes: 25 additions & 1 deletion bin/wp-env-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,31 @@ done
# ---------------------------------------------------------------------------

echo "Flushing rewrite rules..."
npm run --silent wp-env run cli -- wp rewrite structure '/%postname%/' --hard 2>/dev/null
npm run --silent wp-env run cli -- wp rewrite structure '/%postname%/' 2>/dev/null

echo "Writing .htaccess for pretty permalinks..."
WP_CONTAINER=$(docker ps -qf "publish=8888" | head -1)
if [ -z "$WP_CONTAINER" ]; then
echo "Error: Could not find WordPress container on port 8888."
echo "Running containers:"
docker ps --format "{{.ID}} {{.Image}} {{.Ports}} {{.Names}}"
exit 1
fi
echo "Found WordPress container: $WP_CONTAINER"
docker exec -u 0 "$WP_CONTAINER" sh -c 'cat > /var/www/html/.htaccess << "HTACCESS"
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
HTACCESS
'

# ---------------------------------------------------------------------------
# Enable Jetpack blocks module
Expand Down
53 changes: 53 additions & 0 deletions e2e/image-upload.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,59 @@ const TEST_IMAGE = path.resolve( import.meta.dirname, 'assets/test-image.png' );

test.describe( 'Image Upload', () => {
test( 'should upload an image via the Image block', async ( { page } ) => {
// Log all network requests to wp-env for debugging upload issues in CI.
page.on( 'request', ( request ) => {
const url = request.url();
if ( url.includes( 'localhost:8888' ) ) {
// eslint-disable-next-line no-console
console.log(
`[REQ] ${ request.method() } ${ url } headers=${ JSON.stringify(
Object.fromEntries(
Object.entries( request.headers() ).filter(
( [ k ] ) =>
[
'content-type',
'authorization',
'origin',
].includes( k )
)
)
) }`
);
}
} );
page.on( 'response', ( response ) => {
const url = response.url();
if ( url.includes( 'localhost:8888' ) ) {
// eslint-disable-next-line no-console
console.log(
`[RES] ${ response.status() } ${ url } headers=${ JSON.stringify(
Object.fromEntries(
Object.entries( response.headers() ).filter(
( [ k ] ) =>
[
'access-control-allow-origin',
'access-control-allow-headers',
'access-control-allow-methods',
].includes( k )
)
)
) }`
);
}
} );
page.on( 'requestfailed', ( request ) => {
const url = request.url();
if ( url.includes( 'localhost:8888' ) ) {
// eslint-disable-next-line no-console
console.log(
`[FAIL] ${ request.method() } ${ url } failure=${
request.failure()?.errorText
}`
);
}
} );

const editor = new EditorPage( page );
await editor.setup();

Expand Down