-
Notifications
You must be signed in to change notification settings - Fork 42
Handle exit status from the CLI class #310
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
Changes from all commits
eb11d1d
623a5ed
9c59c54
1af1886
e417e05
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,6 +123,7 @@ Feature: Apply command | |
| | + "Vpc": { | | ||
| | Parameters diff: | | ||
| | KeyName: my-key | | ||
| And the exit status should be 0 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Validate the exit status in all Cucumber scenarios. |
||
|
|
||
| Scenario: Run apply nothing and create 2 stacks | ||
| Given I stub the following stack events: | ||
|
|
@@ -147,6 +148,7 @@ Feature: Apply command | |
| Scenario: Run apply with invalid stack | ||
| When I run `stack_master apply foo bar` | ||
| Then the output should contain "Could not find stack definition bar in region foo" | ||
| And the exit status should be 1 | ||
|
|
||
| Scenario: Create stack with --changed | ||
| Given I stub the following stack events: | ||
|
|
@@ -161,6 +163,7 @@ Feature: Apply command | |
| | + "Vpc": { | | ||
| | Parameters diff: | | ||
| | KeyName: my-key | | ||
| And the exit status should be 0 | ||
|
|
||
| Scenario: Run apply with 2 specific stacks and create 2 stacks | ||
| Given I stub the following stack events: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,7 +43,7 @@ Feature: Apply command with allowed accounts | |
| And I run `stack_master apply us-east-1 myapp-db` | ||
| And the output should contain all of these lines: | ||
| | Account '11111111' is not an allowed account. Allowed accounts are ["22222222"].| | ||
| Then the exit status should be 0 | ||
| Then the exit status should be 1 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an example of an incorrect Cucumber validation. This scenario was ensuring a status Now the feature correctly checks the value returned in the command invocation. Note: this is not a change in StackMaster behaviour. |
||
|
|
||
| Scenario: Run apply with stack overriding allowed accounts to allow all accounts | ||
| Given I stub the following stack events: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Feature: Check the StackMaster version | ||
| Scenario: Use the --version option | ||
| When I run `stack_master --version` | ||
| Then the exit status should be 0 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a scenario to ensure |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -227,7 +227,7 @@ def load_config(file) | |
| StackMaster::Config.load!(stack_file) | ||
| rescue Errno::ENOENT => e | ||
| say "Failed to load config file #{stack_file}" | ||
| exit 1 | ||
| @kernel.exit false | ||
| end | ||
|
|
||
| def execute_stacks_command(command, args, options) | ||
|
|
@@ -253,7 +253,7 @@ def execute_stacks_command(command, args, options) | |
| end | ||
| end | ||
| end | ||
| success | ||
| @kernel.exit false unless success | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| end | ||
|
|
||
| def execute_if_allowed_account(allowed_accounts, &block) | ||
|
|
||
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 binstub no longer handles the exit status.