Skip to content
Merged
Show file tree
Hide file tree
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
61 changes: 61 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: E2E Tests

on:
push:
branches: [master]
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
e2e-tests:
runs-on: ubuntu-latest
timeout-minutes: 30

env:
CI: true
NODE_ENV: test

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install system dependencies for Electron
run: |
sudo apt-get update
sudo apt-get install -y libnss3 libatk-bridge2.0-0 libgtk-3-0 libgbm1 libasound2t64

Comment on lines +40 to +44

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/e2e-tests.yml

Repository: stepandel/pinecone-explorer

Length of output: 1941


🌐 Web query:

GitHub Actions ubuntu-latest default packages xvfb xvfb-run preinstalled

💡 Result:

  • ubuntu-latest currently means the GitHub-hosted runner image for Ubuntu 24.04 (same as ubuntu-24.04). [1] (This switch rolled out Dec 5, 2024 → Jan 17, 2025.) [2]
  • Whether xvfb / xvfb-run is preinstalled is not something you should assume from memory because runner images change frequently; GitHub recommends checking the exact runner’s “Included Software” link in your workflow run logs (Set up job → Runner Image → Included Software). [3]
  • If you need it, xvfb-run is provided by the Ubuntu xvfb package (so installing xvfb gives you both Xvfb and xvfb-run). [4]

Practical check in a job step

command -v Xvfb || true
command -v xvfb-run || true
dpkg -l | grep -E '^ii\s+xvfb\s' || true

Install (if missing)

sudo apt-get update
sudo apt-get install -y xvfb

Sources: [1] actions/runner-images repo table (ubuntu-latest → 24.04), [2] runner-images announcement issue, [3] GitHub Docs on “Included Software” link in logs, [4] Ubuntu Launchpad package description for xvfb (mentions xvfb-run).


🌐 Web query:

Ubuntu 24.04 xvfb preinstalled default packages

💡 Result:

On a standard Ubuntu 24.04 LTS (Noble) install, Xvfb is not preinstalled as a default package (it is not part of the ubuntu-desktop metapackage’s dependency list). [1]

If you need it, it’s available as the xvfb package (from the Universe repository) for Ubuntu 24.04 and can be installed via APT. [2]

Sources
[1] Ubuntu package page for ubuntu-desktop (Noble 24.04) — dependency list does not include xvfb: packages.ubuntu.com
[2] Ubuntu package search — xvfb in Noble (24.04) (Universe): packages.ubuntu.com


Add xvfb to system dependencies.

Line 49 uses xvfb-run, which is not preinstalled on ubuntu-latest (Ubuntu 24.04). The workflow will fail without it.

🧩 Suggested patch
-          sudo apt-get install -y libnss3 libatk-bridge2.0-0 libgtk-3-0 libgbm1 libasound2
+          sudo apt-get install -y libnss3 libatk-bridge2.0-0 libgtk-3-0 libgbm1 libasound2 xvfb
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Install system dependencies for Electron
run: |
sudo apt-get update
sudo apt-get install -y libnss3 libatk-bridge2.0-0 libgtk-3-0 libgbm1 libasound2
- name: Install system dependencies for Electron
run: |
sudo apt-get update
sudo apt-get install -y libnss3 libatk-bridge2.0-0 libgtk-3-0 libgbm1 libasound2 xvfb
🤖 Prompt for AI Agents
In @.github/workflows/e2e-tests.yml around lines 40 - 44, The workflow installs
Electron deps but omits the X virtual framebuffer; add the xvfb package to the
apt-get install list so xvfb-run (used later on line 49) is available; update
the Install system dependencies for Electron step by including "xvfb" alongside
libnss3, libatk-bridge2.0-0, libgtk-3-0, libgbm1 and libasound2 so the job can
run xvfb-run successfully.

- name: Build Electron app
run: pnpm test:build

- name: Run E2E tests with Xvfb
run: xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" pnpm exec playwright test
env:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}

Comment on lines +48 to +52

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Guard E2E execution when the secret is unavailable.

Line 51 uses PINECONE_API_KEY. For fork PRs, secrets aren’t provided and this step will fail. Consider skipping or short‑circuiting when the secret is missing.

✅ Suggested guard
       - name: Run E2E tests with Xvfb
+        if: ${{ secrets.PINECONE_API_KEY != '' }}
         run: xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" pnpm exec playwright test
         env:
           PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
+
+      - name: Skip E2E tests (missing PINECONE_API_KEY)
+        if: ${{ secrets.PINECONE_API_KEY == '' }}
+        run: echo "PINECONE_API_KEY not available for this event; skipping E2E tests."
🤖 Prompt for AI Agents
In @.github/workflows/e2e-tests.yml around lines 48 - 52, The E2E step "Run E2E
tests with Xvfb" references the secret PINECONE_API_KEY which is absent for
forked PRs; add a guard to the step (e.g., add an if condition like if: ${{
secrets.PINECONE_API_KEY }} or another expression that checks the secret
presence) so the step is skipped when PINECONE_API_KEY is missing, preserving
the env entry PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} but preventing
failure on forks.

- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: |
playwright-report/
test-results/
retention-days: 7
8 changes: 7 additions & 1 deletion e2e/helpers/electron-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,15 @@ export async function launchApp(): Promise<{ app: ElectronApplication; page: Pag
// Clear encrypted stores to avoid encryption key mismatch
clearEncryptedStores(testUserDataDir);

// Build args - add --no-sandbox for CI environments (GitHub Actions, etc.)
const args = [appPath];
if (process.env.CI) {
args.unshift('--no-sandbox');
}

// Launch Electron app
const app = await electron.launch({
args: [appPath],
args,
Comment on lines +52 to +60

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent argument order: use push instead of unshift.

The --no-sandbox flag is prepended before appPath using unshift, resulting in ['--no-sandbox', appPath]. However, in e2e/electron.setup.ts (lines 79-82), the same logic uses push, placing the app path first: [electronPath, '--no-sandbox'].

For Playwright's electron.launch(), the main script path should typically be the first argument. This inconsistency could cause unexpected behavior and makes the codebase harder to maintain.

Proposed fix to align with electron.setup.ts
   // Build args - add --no-sandbox for CI environments (GitHub Actions, etc.)
   const args = [appPath];
   if (process.env.CI) {
-    args.unshift('--no-sandbox');
+    args.push('--no-sandbox');
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Build args - add --no-sandbox for CI environments (GitHub Actions, etc.)
const args = [appPath];
if (process.env.CI) {
args.unshift('--no-sandbox');
}
// Launch Electron app
const app = await electron.launch({
args: [appPath],
args,
// Build args - add --no-sandbox for CI environments (GitHub Actions, etc.)
const args = [appPath];
if (process.env.CI) {
args.push('--no-sandbox');
}
// Launch Electron app
const app = await electron.launch({
args,
🤖 Prompt for AI Agents
In `@e2e/helpers/electron-app.ts` around lines 52 - 60, The args array is built
with appPath but prepends '--no-sandbox' using args.unshift, causing argument
order mismatch with other setup code and potentially breaking electron.launch;
change the logic to append the flag (use args.push('--no-sandbox') instead of
args.unshift) so args becomes [appPath, '--no-sandbox'] when process.env.CI is
set, ensuring the main script (appPath) remains the first argument passed to
electron.launch.

env: {
...process.env,
NODE_ENV: 'test',
Expand Down