-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Refactor stackstorm.js a bit #177
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c5cc4bb
to
da4dedb
Compare
7d6166f
to
e192b94
Compare
arm4b
approved these changes
Jun 29, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Please add a Changelog, refactoring + more tests is important maintenance work that worth mentioning there.
…ng consistent key ordering
a18a019
to
cddd43a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is composed of cherry-picks from #168 and a tiny bit more refactoring as well.
This PR will be considered a draft PR until StackStorm/st2chatops#124 is fixed, and will then and only then be promoted to being a full PR. I will continuously rebase this branch on top ofmaster
until StackStorm/st2chatops#124 is fixed, so clone this branch AT YOUR OWN RISK.This PR should not change the behavior of
scripts/stackstorm.js
in any way, except for theSIGUSR2
handler now emits a log message to the debug log.Tests for some environment variable settings, and for the
SIGUSR2
handler are included. These tests should be orthogonal to the tests from #168 and/or #172.A note about testing: when (and ONLY when) the test assertions fail, the tests simply hang until they are interrupted with a
SIGINT
(ctrl+c). Unfortunately, as far as I have learned Javascript, this is unavoidable until some of the behavioral refactoring from #168 is implemented (namely: thatst2stream
is properly closed, and hubot is properly shutdown, see thefunction stop
in #168 for a working example). Due to the fact fixing that requires behavioral changes inscripts/stackstorm.js
and this PR deliberately avoids changing the behavioral ofstackstorm.js
(except the one place as noted above), this is considered outside the scope of this PR. When the tests are successful, the tests exit as per normal operation.