Skip to content
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

test: Run mocha tests with Electron #547

Merged
merged 5 commits into from
Dec 7, 2022
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
26 changes: 22 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,32 @@ jobs:
if: ${{ !matrix.docker }}
uses: nick-fields/retry@v2
with:
timeout_minutes: 8
timeout_minutes: 5
max_attempts: 1
command: |
pnpm run clean
pnpm run test.skip_gc_tests
continue-on-error: "${{ contains(matrix.os, 'ubuntu') && !matrix.docker }}"

- name: Test Electron (Main)
if: "${{ contains(matrix.os, 'ubuntu') && !matrix.docker }}"
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 1
command: |
sudo apt-get install xvfb
pnpm install -g electron@latest
pnpm run clean
xvfb-run --auto-servernum pnpm run test.electron.main
# continue-on-error: true

- name: Tests + GC Tests (Release)
if: ${{ !matrix.docker }}
run: |
pnpm run clean
pnpm run test
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 1
command: |
pnpm run clean
pnpm run test
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"chai": "^4.3.7",
"deasync": "^0.1.28",
"downlevel-dts": "^0.11.0",
"electron-mocha": "^11.0.2",
"eslint-config-atomic": "^1.18.1",
"eslint-plugin-prettier": "^4.2.1",
"fs-extra": "^10.1.0",
Expand Down Expand Up @@ -91,8 +92,10 @@
"build.native.debug": "cross-env CMAKE_BUILD_TYPE=Debug node-gyp configure --debug && cross-env CMAKE_BUILD_TYPE=Debug node-gyp build --debug",
"build": "run-s build.js build.native",
"build.debug": "run-s build.js build.native.debug",
"test": "run-s build && mocha",
"test.skip_gc_tests": "run-s build.debug && cross-env SKIP_GC_TESTS=true mocha",
"test": "run-s build && mocha --exit",
"test.skip_gc_tests": "run-s build.debug && cross-env SKIP_GC_TESTS=true mocha --exit",
"test.electron.main": "run-s build && electron-mocha",
"test.electron.renderer": "run-s build && electron-mocha --renderer",
"lint.clang-format": "clang-format -i -style=file ./src/*.cc ./src/*.h ./src/util/*.h",
"lint-test.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
"lint.eslint": "pnpm run lint-test.eslint --fix",
Expand Down
90 changes: 90 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.