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

tagging and testing should fail, not hang, when tests are wrong #32

Open
AlexJeffcott opened this issue May 30, 2019 · 3 comments
Open

Comments

@AlexJeffcott
Copy link

Expected Behavior

the component tagging fails / tests fail to run with an error

Actual Behavior

it hangs with no error

Steps to Reproduce the Problem

1 cd project_directory
2 bit init
3 bit login
4 mkdir src
5 touch try.js
6 in try.js export default (a, b)=>a+b
7 mkdir __tests__
8 touch try.test.js
9 in try.test.js (the try function is not called in the expect method thus creating a test that doesn't work)

import try from "../try";
it('test try', () => expect((1, 2)).toEqual(3));

10 bit add src -t 'src/__tests__/*'
11 bit import bit.envs/compilers/babel -c
12 bit import bit.envs/testers/jest -t
13a bit tag --all 1.0.0
13b bit test

Specifications

  • Bit version: 14.1.1
  • Node version: 12.1.0
  • npm / yarn version: 6.9.0
  • Platform: Ubuntu Bionic Beaver
  • Bit compiler (include version): bit.envs/compilers/babel@7.0.1
  • Bit tester (include version): bit.envs/testers/jest@22.4.3
@AlexJeffcott AlexJeffcott changed the title bit tag --all 1.0.0 hangs when tests are present (Jest) tagging and testing should fail, not hang, when tests are wrong May 30, 2019
@davidfirst davidfirst self-assigned this May 31, 2019
@davidfirst davidfirst transferred this issue from teambit/bit May 31, 2019
@davidfirst davidfirst removed their assignment May 31, 2019
@davidfirst
Copy link
Member

davidfirst commented May 31, 2019

I was able to reproduce the issue.
Just a note, for some reason I got an error during the build, so in step # 9, remove the first line, you don't need it to reproduce the issue.

As far as I can see, this is an issue with the Jest tester.
I started debugging it and it seems like it gets stuck here: return exec(cmd).then.
It doesn't continue to the 'then', nor to the 'catch'.

The bug was originally posted in bit-bin, I transferred it to this repo so you guys hopefully can help.

@GiladShoham
Copy link
Member

We should probably take a look on the compiler implementation and see if we have a hook to get an error or something and send it back to bit

@davidfirst
Copy link
Member

This issue seems to be related to the child-process-promise package this env is using.
See this issue (wasn't fixed since 2016): patrick-steele-idem/child-process-promise#26.
It'd be best to switch to execa instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants