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

Question: is it possible to run electron-mocha within github actions #208

Closed
boly38 opened this issue Feb 16, 2024 · 2 comments · May be fixed by #209
Closed

Question: is it possible to run electron-mocha within github actions #208

boly38 opened this issue Feb 16, 2024 · 2 comments · May be fixed by #209

Comments

@boly38
Copy link

boly38 commented Feb 16, 2024

Hi here ✋

I've got a question:

  • ❓ is it possible to run electron-mocha within github actions ❓

I see in readme a special service for travis but I didnt see github actions notice ?

I notice on my side the following result :

# package.json script definition:
"ci-test": "echo linux ci-test&& export NODE_ENV=githubaction&& c8 --reporter text --reporter=lcov --lines 60 electron-mocha --no-sandbox --trace-warnings --exit --timeout 180000 --unhandled-rejections=strict tests/ci/*.test.js"

# github action stage definition
    - name: Run tests
      run: npm run ci-test
      env:
        # test for electron-mocha
        DISPLAY: :10.0

# github action stage result

Run npm run ci-test
  npm run ci-test
  shell: /usr/bin/bash -e {0}
  env:
    DISPLAY: :10.0
  
> my-project@0.0.4 ci-test
> echo linux ci-test&& export NODE_ENV=githubaction&& c8 --reporter text --reporter=lcov --lines 60 electron-mocha --no-sandbox --trace-warnings --exit --timeout 180000 --unhandled-rejections=strict tests/ci/*.test.js
linux ci-test
[1787:0[2](REDACTEDjob/21668764014?pr=26#step:5:2)16/194805.[3](REDACTEDjob/21668764014?pr=26#step:5:3)60118:ERROR:ozone_platform_x11.cc(2[4](REDACTEDjob/21668764014?pr=26#step:5:4)0)] Missing X server or $DISPLAY
[1787:0216/19480[5](REDACTEDjob/21668764014?pr=26#step:5:5).3[6](REDACTEDjob/21668764014?pr=26#step:5:6)0165:ERROR:env.cc(25[7](REDACTEDjob/21668764014?pr=26#step:5:8))] The platform failed to initialize.  Exiting.
----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------|---------|----------|---------|---------|-------------------
All files |       0 |        0 |       0 |       0 |                   
----------|---------|----------|---------|---------|-------------------
Segmentation fault (core dumped)
Error: Process completed with exit code 13[9](REDACTEDjob/21668764014?pr=26#step:5:10).

I'll try to dig GHactions to see if I find xvfb equivalent, but any help/tips is appreciated

@boly38
Copy link
Author

boly38 commented Feb 16, 2024

Ok so few minutes after asking myself I found this actions that fit my need :
https://github.com/marketplace/actions/setup-xvfb

As a moderate punishment, I will produce PR
🤣

boly38 added a commit to boly38/electron-mocha that referenced this issue Feb 16, 2024
add GithubActions example - Fix jprichardson#208
@inukshuk
Copy link
Collaborator

You can also use xvfb-run. For example just do xvfb-run npm test.

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 a pull request may close this issue.

2 participants