Skip to content
Merged
Changes from all commits
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
96 changes: 69 additions & 27 deletions .github/workflows/e2e-tests-split.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
if: |
(github.event_name != 'workflow_dispatch') ||
(github.event.inputs.browser == 'chromium' || github.event.inputs.browser == 'all')
timeout-minutes: 30
timeout-minutes: 45
env:
CHARON_EMERGENCY_TOKEN: ${{ secrets.CHARON_EMERGENCY_TOKEN }}
CHARON_EMERGENCY_SERVER_ENABLED: "true"
Expand Down Expand Up @@ -200,15 +200,29 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with:
path: ~/.cache/ms-playwright
key: playwright-chromium-${{ hashFiles('package-lock.json') }}

- name: Install & verify Playwright Chromium
run: npx playwright install --with-deps chromium
run: |
echo "⏳ Installing Playwright Chromium (with system dependencies)..."
echo "Start: $(date -u +'%Y-%m-%dT%H:%M:%SZ')"
npx playwright install --with-deps chromium
INSTALL_EXIT=$?
echo "Install exit code: $INSTALL_EXIT"

if [ $INSTALL_EXIT -ne 0 ]; then
echo "::error::Playwright Chromium installation failed"
echo "Cache contents:"
ls -la ~/.cache/ms-playwright/ || echo "Cache directory empty"
exit 1
fi

echo "✅ Verifying Chromium executable..."
if npx playwright test --list --project=chromium 2>&1 | grep -q "Chromium"; then
echo "✅ Chromium executable verified"
else
echo "::error::Chromium executable not found after installation"
exit 1
fi
Comment on lines +218 to +224
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The “verify executable” check is not reliable: npx playwright test --list --project=chromium only lists tests and typically won’t validate that the Chromium browser binary exists/is runnable. Additionally, grepping for the string "Chromium" is brittle (output is often "chromium" or may not include the browser name at all), which can cause false passes or false failures in CI. Prefer verifying via Playwright’s executable path (e.g., query chromium.executablePath() and assert the file exists/is executable) or a minimal launch check instead of --list + grep.

Suggested change
echo "✅ Verifying Chromium executable..."
if npx playwright test --list --project=chromium 2>&1 | grep -q "Chromium"; then
echo "✅ Chromium executable verified"
else
echo "::error::Chromium executable not found after installation"
exit 1
fi
echo "✅ Verifying Chromium executable via Playwright API..."
node - <<'NODE'
const fs = require('fs');
const { chromium } = require('playwright');
try {
const execPath = chromium.executablePath();
if (!execPath) {
console.error('::error::Chromium executable path is empty or undefined after installation');
process.exit(1);
}
try {
fs.accessSync(execPath, fs.constants.X_OK);
console.log('✅ Chromium executable verified at:', execPath);
process.exit(0);
} catch (accessErr) {
console.error('::error::Chromium executable is not accessible or not executable at:', execPath);
console.error(accessErr.message);
process.exit(1);
}
} catch (err) {
console.error('::error::Failed to resolve Chromium executable path via Playwright');
console.error(err && err.message ? err.message : err);
process.exit(1);
}
NODE
VERIFY_EXIT=$?
if [ $VERIFY_EXIT -ne 0 ]; then
echo "::error::Chromium executable verification failed"
exit 1
fi

Copilot uses AI. Check for mistakes.
echo "Completion: $(date -u +'%Y-%m-%dT%H:%M:%SZ')"

- name: Run Chromium tests (Shard ${{ matrix.shard }}/${{ matrix.total-shards }})
run: |
Expand Down Expand Up @@ -284,7 +298,7 @@ jobs:
if: |
(github.event_name != 'workflow_dispatch') ||
(github.event.inputs.browser == 'firefox' || github.event.inputs.browser == 'all')
timeout-minutes: 30
timeout-minutes: 45
env:
CHARON_EMERGENCY_TOKEN: ${{ secrets.CHARON_EMERGENCY_TOKEN }}
CHARON_EMERGENCY_SERVER_ENABLED: "true"
Expand Down Expand Up @@ -363,15 +377,29 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with:
path: ~/.cache/ms-playwright
key: playwright-firefox-${{ hashFiles('package-lock.json') }}

- name: Install & verify Playwright Firefox
run: npx playwright install --with-deps firefox
run: |
echo "⏳ Installing Playwright Firefox (with system dependencies)..."
echo "Start: $(date -u +'%Y-%m-%dT%H:%M:%SZ')"
npx playwright install --with-deps firefox
INSTALL_EXIT=$?
echo "Install exit code: $INSTALL_EXIT"

if [ $INSTALL_EXIT -ne 0 ]; then
echo "::error::Playwright Firefox installation failed"
echo "Cache contents:"
ls -la ~/.cache/ms-playwright/ || echo "Cache directory empty"
exit 1
fi

echo "✅ Verifying Firefox executable..."
if npx playwright test --list --project=firefox 2>&1 | grep -q "Firefox"; then
echo "✅ Firefox executable verified"
else
echo "::error::Firefox executable not found after installation"
exit 1
fi
Comment on lines +395 to +401
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

The Firefox “executable verification” is likely ineffective/brittle: playwright test --list --project=firefox | grep "Firefox" doesn’t reliably prove the Firefox binary exists (listing tests doesn’t launch browsers), and the grep text may not match Playwright output consistently. Use a deterministic check (e.g., resolve firefox.executablePath() and verify the file exists/is executable, or perform a minimal launch) so this step actually catches missing executables early without flaking.

Suggested change
echo "✅ Verifying Firefox executable..."
if npx playwright test --list --project=firefox 2>&1 | grep -q "Firefox"; then
echo "✅ Firefox executable verified"
else
echo "::error::Firefox executable not found after installation"
exit 1
fi
echo "✅ Verifying Firefox executable by launching a minimal browser instance..."
node <<'EOF'
(async () => {
try {
const { firefox } = require('playwright');
const browser = await firefox.launch();
const version = browser.version();
console.log(`✅ Firefox launched successfully (version: ${version})`);
await browser.close();
} catch (error) {
console.error('::error::Failed to launch Firefox via Playwright:', error);
process.exit(1);
}
})();
EOF

Copilot uses AI. Check for mistakes.
echo "Completion: $(date -u +'%Y-%m-%dT%H:%M:%SZ')"

- name: Run Firefox tests (Shard ${{ matrix.shard }}/${{ matrix.total-shards }})
run: |
Expand Down Expand Up @@ -447,7 +475,7 @@ jobs:
if: |
(github.event_name != 'workflow_dispatch') ||
(github.event.inputs.browser == 'webkit' || github.event.inputs.browser == 'all')
timeout-minutes: 30
timeout-minutes: 45
env:
CHARON_EMERGENCY_TOKEN: ${{ secrets.CHARON_EMERGENCY_TOKEN }}
CHARON_EMERGENCY_SERVER_ENABLED: "true"
Expand Down Expand Up @@ -526,15 +554,29 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with:
path: ~/.cache/ms-playwright
key: playwright-webkit-${{ hashFiles('package-lock.json') }}

- name: Install & verify Playwright WebKit
run: npx playwright install --with-deps webkit
run: |
echo "⏳ Installing Playwright WebKit (with system dependencies)..."
echo "Start: $(date -u +'%Y-%m-%dT%H:%M:%SZ')"
npx playwright install --with-deps webkit
INSTALL_EXIT=$?
echo "Install exit code: $INSTALL_EXIT"

if [ $INSTALL_EXIT -ne 0 ]; then
echo "::error::Playwright WebKit installation failed"
echo "Cache contents:"
ls -la ~/.cache/ms-playwright/ || echo "Cache directory empty"
exit 1
fi

echo "✅ Verifying WebKit executable..."
if npx playwright test --list --project=webkit 2>&1 | grep -q "WebKit"; then
echo "✅ WebKit executable verified"
else
echo "::error::WebKit executable not found after installation"
Comment on lines +573 to +576
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

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

Same issue for WebKit: playwright test --list --project=webkit | grep "WebKit" is not a reliable signal that the WebKit browser executable is present/usable, and the grep match can be inconsistent. Consider replacing with a deterministic executable-path existence check (or minimal launch) so the workflow fails fast for the right reason and avoids accidental false negatives/positives.

Suggested change
if npx playwright test --list --project=webkit 2>&1 | grep -q "WebKit"; then
echo "✅ WebKit executable verified"
else
echo "::error::WebKit executable not found after installation"
WEBKIT_CACHE_GLOB="$HOME/.cache/ms-playwright/webkit-*"
if compgen -G "$WEBKIT_CACHE_GLOB" > /dev/null; then
echo "✅ WebKit executable directory found:"
ls -ld $WEBKIT_CACHE_GLOB || true
else
echo "::error::WebKit executable directory not found after installation"
ls -la ~/.cache/ms-playwright/ || echo "Cache directory missing or empty"

Copilot uses AI. Check for mistakes.
exit 1
fi
echo "Completion: $(date -u +'%Y-%m-%dT%H:%M:%SZ')"

- name: Run WebKit tests (Shard ${{ matrix.shard }}/${{ matrix.total-shards }})
run: |
Expand Down
Loading