-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add GitHub Actions workflow for E2E tests #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
|
|
||
| - 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard E2E execution when the secret is unavailable. Line 51 uses ✅ 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 |
||
| - name: Upload test artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: playwright-report | ||
| path: | | ||
| playwright-report/ | ||
| test-results/ | ||
| retention-days: 7 | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent argument order: use The For Playwright's 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
| env: { | ||||||||||||||||||||||||||||||||||||||||
| ...process.env, | ||||||||||||||||||||||||||||||||||||||||
| NODE_ENV: 'test', | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: stepandel/pinecone-explorer
Length of output: 1941
🌐 Web query:
GitHub Actions ubuntu-latest default packages xvfb xvfb-run preinstalled💡 Result:
ubuntu-latestcurrently means the GitHub-hosted runner image for Ubuntu 24.04 (same asubuntu-24.04). [1] (This switch rolled out Dec 5, 2024 → Jan 17, 2025.) [2]xvfb/xvfb-runis 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]xvfb-runis provided by the Ubuntuxvfbpackage (so installingxvfbgives you bothXvfbandxvfb-run). [4]Practical check in a job step
Install (if missing)
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(mentionsxvfb-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-desktopmetapackage’s dependency list). [1]If you need it, it’s available as the
xvfbpackage (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 includexvfb: packages.ubuntu.com[2] Ubuntu package search —
xvfbin Noble (24.04) (Universe): packages.ubuntu.comAdd
xvfbto system dependencies.Line 49 uses
xvfb-run, which is not preinstalled onubuntu-latest(Ubuntu 24.04). The workflow will fail without it.🧩 Suggested patch
📝 Committable suggestion
🤖 Prompt for AI Agents