Skip to content

Add Electron CI tests for Dependabot PR validation#183

Merged
kovtcharov-amd merged 12 commits intoamd:mainfrom
kovtcharov:kalin/electron-ci-tests
Jan 16, 2026
Merged

Add Electron CI tests for Dependabot PR validation#183
kovtcharov-amd merged 12 commits intoamd:mainfrom
kovtcharov:kalin/electron-ci-tests

Conversation

@kovtcharov
Copy link
Collaborator

Add robust CI workflow to validate Electron apps when Dependabot submits PRs.

  • Add framework integration tests for Dependabot PR validation
  • Enable Dependabot PRs for all Electron apps
  • Fix npm workspace dependency installation in CI
  • Fix electron-forge finding electron in workspace setup

- Add EMR Dashboard to Dependabot config and test matrix
- Add EMR Dashboard integration tests (test_emr_dashboard.js)
- Add headless E2E runtime tests that launch Electron apps
- Make build failures blocking (remove continue-on-error)
- Add version consistency and structure validation
- Remove deprecated spectron dependency

When Dependabot updates Electron versions, these tests will catch:
- Missing or broken entry points
- Invalid package.json configurations
- Electron API breaking changes (via runtime launch tests)
- Version inconsistencies between apps and framework
- Add test_framework_integration.js with 32 tests covering:
  - Framework core validation (main.js, app-controller, services)
  - App structure compliance (example and jira apps)
  - Throwaway app creation test (validates framework contract)
  - Version compatibility matrix across all apps
  - Security configuration validation (nodeIntegration, contextIsolation)

- Update workflow to run framework integration tests

The throwaway app test is the key TDD test:
- Creates a minimal app using the same pattern as documented apps
- Uses the same Electron version that Dependabot would update
- Verifies the framework contract is not broken by updates

Total: 84 tests across 5 test files
Renamed for clarity:
- test_jira_app.js -> test_electron_jira_app.js
- test_example_app.js -> test_electron_example_app.js
- test_emr_dashboard.js -> test_electron_emr_dashboard.js
- test_functional.js -> test_electron_functional.js
- test_framework_integration.js -> test_electron_framework_integration.js

Updated workflow references to match new filenames.
Dependabot config changes:
- Enable PRs for Example app (was monitor-only, now limit: 1)
- Enable PRs for Jira app (was monitor-only, now limit: 1)
- All Electron apps now on weekly schedule (Monday)
- Added 'electron' label to all Electron app configs

Test changes:
- Throwaway app test now uses FRAMEWORK electron version
  (src/gaia/electron/package.json) as the canonical source
- This ensures the test validates against what Dependabot updates

Now Dependabot will update:
- Root package.json (npm workspaces master)
- src/gaia/electron (framework)
- src/gaia/apps/example/webui
- src/gaia/apps/jira/webui
- src/gaia/agents/emr/dashboard/electron
Review feedback addressed:

1. Unused imports (test_electron_framework_integration.js)
   - Removed unused `execSync` and `spawn` from imports

2. Hardcoded version requirements
   - Extracted MIN_ELECTRON_VERSION (31) and MIN_FORGE_VERSION (7) as constants
   - Added detailed documentation explaining why these versions are required
   - Constants are now in one place for easy maintenance

3. Hardcoded 5-second timeout
   - Made configurable via ELECTRON_LAUNCH_TIMEOUT_MS environment variable
   - Added documentation explaining why 5 seconds is the default
   - Apps with heavy initialization can override if needed

4. Platform-specific packaging
   - Added comments clarifying this runs on Linux (ubuntu-latest)
   - Windows/macOS packaging is tested in separate workflow
   - Added DEBUG output for electron-forge troubleshooting
The apps (jira, example) are part of npm workspaces defined in root
package.json. Running 'npm ci' in the subdirectory doesn't work because
workspaces hoist dependencies to the root node_modules.

Fix: Install from root directory which properly installs all workspace
dependencies including electron.
electron-forge uses the local package-lock.json to determine project root
and expects electron to be installed there. With npm workspaces, dependencies
are hoisted to root but forge still looks locally.

Fix: Run npm install in app directory after root npm ci to ensure electron
is available where forge expects it.
@kovtcharov kovtcharov requested a review from itomek-amd January 15, 2026 01:28
@kovtcharov kovtcharov self-assigned this Jan 15, 2026
@github-actions github-actions bot added devops DevOps/infrastructure changes tests Test changes labels Jan 15, 2026
Use npm ci --prefix . from the app directory instead of installing
from root with workspaces. This matches the pattern in build-electron-apps.yml
and ensures electron is installed locally where electron-forge expects it.
@kovtcharov kovtcharov enabled auto-merge January 15, 2026 02:11
@kovtcharov kovtcharov added this pull request to the merge queue Jan 16, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 16, 2026
@kovtcharov-amd kovtcharov-amd merged commit 9953eda into amd:main Jan 16, 2026
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps/infrastructure changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants