-
Notifications
You must be signed in to change notification settings - Fork 72
Update init.sh to exit 0 for "already running" #110
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
Conversation
| if [[ $? == 0 ]]; then | ||
| echo "Process is already running" | ||
| exit 1 | ||
| exit 0 |
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.
test?
| // try all of the service commands | ||
| exec('dist/service-name-0.1/service/bin/init.sh', 'start') ==~ /(?m)Running 'service-name'\.\.\.\s+Started \(\d+\)\n/ | ||
| file('dist/service-name-0.1/var/log/service-name-startup.log', projectDir).text.contains('Test started\n') | ||
| exec('dist/service-name-0.1/service/bin/init.sh', 'start') ==~ /(?m)Process is already running\n/ |
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.
this isn't verifying the return value, right?
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.
Yeah I just ran the test on develop and it passed (so doesn't catch the bug), working on making exec() check the return code. I think there's an assumption throughout this suite that it returns 0 so I can bake in an assertion - you cool with that?
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.
bake it into exec()? yeah that sounds ok.
On Wed, Aug 24, 2016 at 12:15 AM Brad Moylan notifications@github.com
wrote:
In
src/test/groovy/com/palantir/gradle/javadist/JavaDistributionPluginTests.groovy
#110 (comment)
:@@ -61,6 +61,7 @@ class JavaDistributionPluginTests extends GradleTestSpec {
// try all of the service commands
exec('dist/service-name-0.1/service/bin/init.sh', 'start') ==~ /(?m)Running 'service-name'...\s+Started (\d+)\n/
file('dist/service-name-0.1/var/log/service-name-startup.log', projectDir).text.contains('Test started\n')
exec('dist/service-name-0.1/service/bin/init.sh', 'start') ==~ /(?m)Process is already running\n/Yeah I just ran the test on develop and it passed (so doesn't catch the
bug), working on making exec() check the return code. I think there's an
assumption throughout this suite that it returns 0 so I can bake in an
assertion - you cool with that?—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
https://github.com/palantir/gradle-java-distribution/pull/110/files/d60f68511ee7ffd2c83e11735f7a81de586c4c63#r75992572,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGOdweNkSo0licjQCLAaX8qrzeWYCHlBks5qi8VCgaJpZM4Jrmwi
.
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.
done
|
For reference: http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html requires |
|
👍 |
Fixes #109
This change is