question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Passing "CI=true" fails to prevent successful build when tests fail if building on Linux (bash)

See original GitHub issue

Is this a bug report?

Yes.

Did you try recovering your dependencies?

Yes.

Which terms did you search for in User Guide?

N/A

Environment

System: OS: Linux 4.18 Ubuntu 18.10 (Cosmic Cuttlefish) CPU: x64 Intel® Core™ i7-3770 CPU @ 3.40GHz Binaries: Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node npm: 6.4.1 - ~/.nvm/versions/node/v10.13.0/bin/npm Browsers: Chrome: 70.0.3538.102 Firefox: 63.0 npmPackages: react: ^16.6.3 => 16.6.3 react-dom: ^16.6.3 => 16.6.3 react-scripts: 2.1.1 => 2.1.1 npmGlobalPackages: create-react-app: Not Found

Steps to Reproduce

  1. Write tests, (shallow, using enzyme), as described in the official docs, here: https://facebook.github.io/create-react-app/docs/running-tests
  2. Ensure one of the tests fails when running: npm run test
  3. Attempt to build, by running: CI=true npm run build

Expected Behavior

The build would fail, due to the failure of the test.

Actual Behavior

The build succeeds without any issues.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Aninstancecommented, Nov 19, 2018

It’s just using npm test as an example, “Like npm test” – the behavior you’re opting into is “perform a linter warning check [and fail the build]”.

Send a PR clarifying docs?

Oh right, my mistake, sorry. I was conflating linter warnings and the jest tests, reading it as “force the build to perform a linter warning check [AND TESTS] by setting the environment variable CI…”.

I doubt doc clarification is necessary; my stupidity is an extreme edge case 😆

0reactions
stale[bot]commented, Dec 25, 2018

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Step Should Fail but Job Finished Successfully
Dictating a Pass or Fail Steps will pass or fail based on the error code that is raised from the processes launched within...
Read more >
Failure in make fails to halt shell script - Stack Overflow
You have: make VERBOSE=1 if [ $retVal -ne 0 ]; then. but retVal is still the return code of the cmake command. Either...
Read more >
How to conditionally do something if a command succeeded ...
How to conditionally do something if a command succeeded or failed. That's exactly what bash's if statement does: if command ; then echo ......
Read more >
7.1. Introduction to if
The [ (or test) built-in evaluates conditional expressions using a set of rules based on the number of arguments. More information about this...
Read more >
Run Java Tests With Maven Silently (Only Log on Failure)
While this log output can help understand test failures, it's typically superfluous when our test suite is passing. Nobody will take a look...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found