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

Non zero exit on error #40

Merged
merged 7 commits into from
Sep 21, 2016
Merged

Non zero exit on error #40

merged 7 commits into from
Sep 21, 2016

Conversation

mstade
Copy link
Member

@mstade mstade commented Sep 19, 2016

Description

These changes ensure we exit with a non-zero code whenever the build has non-recoverable errors.

Motivation and Context

Exit codes are used to determine the success or failure of a program, and is often the only reliable way of answering the binary question: did the damn thing work? Before, and this was an oversight, ez-build only exited with a non-zero code when it detected ignored promise rejections – build errors would still result in a zero exit code. With these changes, we ensure that if there are any errors during the build, we exit properly.

How Was This Tested?

Test added in broken-project.bats.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change follows the style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the contribution guidelines
  • I have added tests to cover my changes
  • All new and existing tests passed

This is a remnant of when test and coverage scripts where combined.
Warnings should not result in a non-zero exit status, however.
@codecov-io
Copy link

codecov-io commented Sep 19, 2016

Current coverage is 86.59% (diff: 100%)

Merging #40 into master will increase coverage by 1.37%

@@             master        #40   diff @@
==========================================
  Files            15         15          
  Lines           257        261     +4   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            219        226     +7   
+ Misses           38         35     -3   
  Partials          0          0          

Powered by Codecov. Last update 7f88c57...9cbe09b

This can probably be expanded significantly, but a decent start.
The tests break from other tests in this suite, in that it relies
on the fixture's build script for settings. This has the benefit
of not needing to update the tests because we change the fixture,
but on the other hand we have to add some logic to make sure we
link the accurate ez-build version when testing.

We also need to ensure we install npm dependencies, but this adds
considerable overhead to the execution time of the test,
so we only do it in case `node_modules/` doesn't already exist.
@mstade mstade merged commit 71e04f4 into master Sep 21, 2016
@mstade mstade deleted the non-zero-exit-on-error branch September 21, 2016 09:30
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 this pull request may close these issues.

None yet

2 participants