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

Windows build on GitHub Actions CI has exit code 1 with passing tests #9413

Closed
Deseteral opened this issue Jan 15, 2020 · 14 comments
Closed

Comments

@Deseteral
Copy link

Deseteral commented Jan 15, 2020

🐛 Bug Report

Jest quits with exit code 1 even though all tests are passing. This happens only on GitHub Actions CI on Windows.

> jest

PASS src/some.test.js
##[error]Process completed with exit code 1.

Ubuntu and MacOS builds are working correctly. When I run the same test suite on my personal Windows PC it also works (tests are passing and %errorlevel% is 0).

jest

I've notices this behaviour on Electron+TypeScript project so I thought that maybe there is something wrong with configuration, but then I've created simple repo to reproduce the problem without TypeScript and without any configuration and the issue still persists.

To Reproduce

Run jest on GitHub Actions CI.

Expected behavior

When all tests are passing jest should stop with exit code 0.

Link to repl or repo (highly encouraged)

Repo: https://github.com/Deseteral/jest-gh-actions-issue
Logs of last failing build: https://github.com/Deseteral/jest-gh-actions-issue/commit/dc21dd4b95bbe88ef73163156f4cdac0a253b37d/checks?check_suite_id=402904990

envinfo

envinfo on GitHub Actions CI with windows-latest OS:

  System:
    OS: Windows 10 10.0.17763
    CPU: (2) x64 Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
  Binaries:
    Node: 12.14.1 - C:\hostedtoolcache\windows\node\12.14.1\x64\node.EXE
    Yarn: 1.21.1 - C:\npm\prefix\yarn.CMD
    npm: 6.13.4 - C:\hostedtoolcache\windows\node\12.14.1\x64\npm.CMD
  npmPackages:
    jest: ^24.9.0 => 24.9.0 
@SimenB
Copy link
Member

SimenB commented Jan 16, 2020

This is very odd, and the first I've heard of it - surely somebody else has tried to use Jest on GH Actions CI? I've set it up myself here: https://github.com/jest-community/eslint-plugin-jest/runs/385531999. It's also missing the footer.

I have absolutely no idea how to debug this, maybe @ericsciple (or someone they can poke) could shed some light on this?

@dkundel
Copy link

dkundel commented Jan 16, 2020

Hi there! I'm having the same issue. You can see an example here:
https://github.com/twilio-labs/sample-template-nodejs/pull/20/checks

@Deseteral
Copy link
Author

I thought maybe the difference was running yarn instead of npm, so I created test branch with yarn, but that wasn't the case:
https://github.com/Deseteral/jest-gh-actions-issue/commit/555e00e47dcc93140d7040fa19647a39f2a99b41/checks?check_suite_id=405789769

@ericsciple
Copy link

ericsciple commented Jan 19, 2020

Does it only fail on Windows when using the hosted runner, e.g. runs-on: windows-latest? Or does it also fail when you setup a self-hosted runner?

That may help narrow whether it's related to the VM image for the hosted Windows runners, or whether it's related to the actual runner itself (the program that runs the job locally on the machine and posts logs back to the service).

If it fails on self-hosted runner also, then try take the runner out of the picture and see if it fails from a plain command prompt on that same machine.

fwiw we're using jest on several repos (e.g. this one) and it's working on the hosted windows-latest runner

@Supereg
Copy link

Supereg commented Jan 19, 2020

Got the same problem and maybe the following information helps.

The described problem occurs when using the runs-on option (so not using a self-hosted runners).
Github currently supports three versions: windows-latest, windows-2019 and windows-2016.
The only version jest successfully runs on (for me) is windows-2016. On the other two (or are they the same?) it crashes as described above.

@ericsciple
Copy link

thanks @Supereg that helps rule out the runner itself and points to the VM.

The repo actions/virtual-environments contains the scripts that build the VM image.

I would recommend file an issue in that repo, and request advice how to debug an issue only failing on windows-2019 (i.e. windows-latest) and not windows-2016. I am hopeful they may have some advice like how to setup the VM image locally for debugging. Or they may have other suggestions. @thejoebourneidentity @densto88 @stbeam fyi

StephenGibbsDev added a commit to StephenGibbsDev/MTGCore that referenced this issue Feb 26, 2020
LoveAndCoding added a commit to LoveAndCoding/lovely-inbox that referenced this issue Mar 8, 2020
This jest issue mentions having similar problems with jest. The
recommendation there was to downgrade. Gonna try it.
jestjs/jest#9413
@netheril96
Copy link

Same problem here. I wrote native code so at first I thought my code had memory access issue.

https://github.com/netheril96/securefs/runs/524324735?check_suite_focus=true

@thejoebourneidentity
Copy link

@Deseteral and others, please open an issue for this over at actions/virtual-environments so the Actions team can help and look into why this might be happening. Thanks

@Deseteral
Copy link
Author

@thejoebourneidentity thanks for suggestion, I just did that :)

@Deseteral
Copy link
Author

Deseteral commented Mar 24, 2020

It looks like the issue doesn't occur anymore. My two repos with windows builds now have passing tests.

@thejoebourneidentity
Copy link

Great to hear. Feel free to close issues and reach out to us again if you see it again!

@LucaHermann
Copy link

LucaHermann commented Jan 18, 2021

Hi everybody i hope you got a good day !
I got the same problem with my actions for ubuntu-latest.
The jest tests pass all but because the Process completed with exit code 1. I got an error and my action come back false..
Anyone can give me a method for fix this please and allow my action to pass ?

this is my ts.yml

name: Typescript/Javascript
on: push
jobs:
  eslint-js:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Install modules
      run: cd js && npm install
    - name: Run ESLint
      run: cd js/src && npx eslint ./ --ext .js,.jsx,.ts,.tsx

  eslint-ts:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Install modules
      run: cd ts && npm install
    - name: Run ESLint
      run: cd ts/src && npx eslint ./ --ext .js,.jsx,.ts,.tsx
  
  jest-ts:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Install modules
      run: cd ts && npm install
    - name: Run tests
      run: cd ts/src && npx jest --collectCoverage

Only the jest-ts have this behaviour.

@neilyoung
Copy link

Got kind of the same issue with an off-the-shell compilation of Pangolin. The change from windows-latest back to windows-2016 solved it.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants