Passing "CI=true" fails to prevent successful build when tests fail if building on Linux (bash)
See original GitHub issueIs 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
- Write tests, (shallow, using enzyme), as described in the official docs, here: https://facebook.github.io/create-react-app/docs/running-tests
- Ensure one of the tests fails when running:
npm run test
- 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:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 😆
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.