Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 23, 2025

Summary

Fixes the linux-e2e test failure in the desktop_cd.yaml pipeline with a two-part solution addressing sequential issues discovered during debugging.

Root causes:

  1. On Ubuntu 24.04, the webkit2gtk-driver package installs WebKitWebDriver to a versioned library directory (e.g., /usr/lib/x86_64-linux-gnu/webkit2gtk-4.1/) that's not on PATH by default, causing tauri-driver to fail with can not find binary WebKitWebDriver in the PATH.
  2. After fixing the PATH issue, tauri-driver itself panics during GTK initialization because it starts in onPrepare before xvfb is initialized, resulting in Failed to initialize gtk backend error.

Solutions:

Part 1 - WebKitWebDriver PATH (scripts/setup-desktop-e2e.sh):

  1. Install the webkit2gtk-driver package (as before)
  2. Verify WebKitWebDriver is actually callable from PATH
  3. If not found, locate the binary using dpkg -L and create a symlink to /usr/local/bin/WebKitWebDriver
  4. Validate the symlink works before proceeding

Part 2 - GTK Initialization (apps/desktop-e2e/wdio.conf.js):

  • Wrap tauri-driver with xvfb-run when running in CI (detected via CI env var)
  • This provides a virtual display before tauri-driver starts, allowing GTK to initialize successfully
  • Local development is unaffected (no xvfb-run wrapper)

Review & Testing Checklist for Human

  • Verify both fixes work together in CI on Ubuntu 24.04: The fixes haven't been tested locally on Ubuntu 24.04 (only analyzed via CI logs). Check that the desktop_cd workflow's linux-e2e step succeeds end-to-end.
  • Check tauri-driver starts with xvfb-run: Look for "Starting tauri-driver with xvfb-run..." and "Listening" messages in CI logs to confirm the driver starts successfully.
  • Verify WebKitWebDriver symlink creation: Look for the "Creating symlink at /usr/local/bin/WebKitWebDriver" message in the setup-desktop-e2e.sh output (or "WebKitWebDriver already available in PATH" on systems where it's already there).
  • Confirm e2e tests actually run and pass: Ensure the tests don't just start but actually execute and pass (check for test results in the logs, not just that tauri-driver starts).
  • Watch for timing issues: Monitor for any race conditions or timeout errors that might indicate the xvfb-run wrapper introduces delays.

Test Plan

  1. Trigger a desktop_cd workflow run with channel=staging
  2. Monitor the linux-e2e step in the build-linux job
  3. Verify the setup script output shows WebKitWebDriver is available
  4. Confirm tauri-driver starts with xvfb-run and prints "Listening"
  5. Check that e2e tests run without ECONNREFUSED or GTK initialization errors
  6. Verify tests complete successfully with passing results

Notes

  • The setup script is idempotent and safe to run multiple times (uses ln -sf for force symlink)
  • On Ubuntu 22.04 (where WebKitWebDriver is already in /usr/bin/), the script will skip the symlink creation
  • The xvfb-run wrapper only activates in CI environments (via process.env.CI check)
  • The first fix (WebKitWebDriver PATH) worked correctly but revealed the second issue (GTK initialization)
  • Session: https://app.devin.ai/sessions/88e8e515471946cb89aa9207d18ba215
  • Requested by: yujonglee (yujonglee.dev@gmail.com, @yujonglee)

The webkit2gtk-driver package on Ubuntu 24.04 may install WebKitWebDriver
to a versioned library directory that's not on PATH by default. This causes
tauri-driver to fail with 'can not find binary WebKitWebDriver in the PATH'.

This fix:
- Checks if webkit2gtk-driver package is installed
- Verifies WebKitWebDriver is callable from PATH
- If not, locates the binary using dpkg -L and creates a symlink to /usr/local/bin
- Validates the symlink works before proceeding

This ensures tauri-driver can find WebKitWebDriver regardless of where
the package installs it.

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Nov 23, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 7dc4604
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6922a2fb41dee90008ce4f08
😎 Deploy Preview https://deploy-preview-1806--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Nov 23, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1763875649-fix-linux-e2e-webkitwebdriver

Comment @coderabbitai help to get the list of available commands and usage tips.

The previous fix ensured WebKitWebDriver was in PATH, which worked.
However, tauri-driver itself needs GTK/X11 to initialize its event loop.

In CI, tauri-driver was starting in onPrepare before xvfb was initialized,
causing GTK initialization to fail with 'Failed to initialize gtk backend'.

This fix wraps tauri-driver with xvfb-run when running in CI (detected via
CI env var), providing a virtual display before tauri-driver starts.

Local development is unaffected (no xvfb-run wrapper).

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration devin-ai-integration bot changed the title Fix linux-e2e: ensure WebKitWebDriver is in PATH Fix linux-e2e: WebKitWebDriver PATH and tauri-driver GTK initialization Nov 23, 2025
@yujonglee yujonglee merged commit 18f759c into main Nov 23, 2025
6 checks passed
@yujonglee yujonglee deleted the devin/1763875649-fix-linux-e2e-webkitwebdriver branch November 23, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants