-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Regression: exit status
not waiting for run interactively
process to complete
#432
Comments
@mrod Thanks for reporting this. This is weird and should not happen.
Questions
Help
|
Thanks @maxmeyer, starting on debugging but might need a little help. I've currently modified the step to be like the following: @wip
Scenario Outline: Wrapped `git reset` can handle files with spaces properly
Given I am in a git repository
Given an empty file named "file with spaces.txt"
###AAA
Given I successfully run `git add "file with spaces.txt"`
###BBB
Given I run `<shell>` interactively
And I type `eval "$(scmpuff init -ws)"`
And I type "scmpuff_status"
And I type "git reset 1"
And I type "echo 'DEBUG: PHASE BBB'"
And I type "exit"
### BELOW IS NEW
Then the exit status should be 0
Then I print the value of last command stopped
Then I manually sent a stop event to runtime monitor
Then I print the value of last command stopped
Then the exit status should be 0
### ABOVE IS NEW
### ^^^ this is checking exit status of AAA, not BBB!
# Then the output should contain "BBB"
### ^^^ this command however, would force aruba to wait until BBB completes (super hacky option #1)
# Then I stop the command started last
### ^^^ (hacky option #2) also seems to ensure BBB completes, but throws a deprecation error
###CCC
### currently, this phase is failing, because it is taking place *BEFORE* BBB completes
When I run `scmpuff status`
Then the stdout from "scmpuff status" should contain:
"""
untracked: [1] file with spaces.txt
"""
Examples:
| shell |
| bash | With new step definitions: #
# for debugging cucumber/aruba#432
#
Then(/^I print the value of last command stopped$/) do
puts last_command_stopped
end
Then(/^I manually sent a stop event to runtime monitor$/) do
# TODO: not working
event_bus.notify Events::CommandStopped.new(self)
end On the first debug evocation, However, I'm having trouble figuring out how to properly send the "stop" event to the proper place within a step definition for debugging -- could you please help with the correct way to define that? Thanks! |
Thanks. I will get to this soon - hopefully. |
I think what happens here is this:
I have checked version 0.6.2, and the implementation of |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective. |
I think this issue still exists & I'm going to take a look at it. |
I've looked again at the 0.6.2 implementation, and it stops all processes unless it has deliberately stopped a process before. In the case of this scenario, this means it stops all processes. |
@mroth I'm afraid you will have to add some step that waits for the interactive command to finish. This would be either |
Documentation about this should probably be improved, since the interaction between steps is not very clear in this case. A step definition like |
Aruba changed its process management which made this harder: cucumber/aruba#432
see cucumber/aruba#432 for details and this suggested workaround.
* build(ci): test switch to aruba 2.0 * build(ci): update travis for aruba2 * fix(ci): aruba current_directory scope * build(ci): workaround to allow directory escape in aruba2 * build(ci): publish cucumber report from travis * build(ci): safer tmpdir in aruba * build(ci): workaround for cucumber/aruba#432 see cucumber/aruba#432 for details and this suggested workaround.
Summary
In version
0.6.2
, arun interactively
step followed by athe exit status should be
step would complete, allowing the results of the process to be examined (as well as ensuring any side effects were complete before moving on to additional steps).Upon updating to latest stable
0.14.2
, this no longer happens, causing commands to run out of order, and all the workarounds I can think of seem fairly hacky and undesirable. It appearsrun interactively
is now functioning as a "background" process by default?I believe this may be a regression/bug?, since that doesn't appear to be the goal of the behavior from sample Features.
Expected Behavior
There should be a way to let an interactive process complete before checking it's exit status, or another mechanism to avoid "out of order" problems.
Current Behavior
I've annotated the actual Scenario Outline in my test cases here to illustrate what is happening, see comments inline:
Possible Solution
I've indicated two possible workarounds in the above code sample comments, but neither seems like it's the intended solution (and one throws a deprecation warning).
Context & Motivation
In our tests, we need to do some stuff in an interactive shell (as our program modifies the shell environment for end-users as it's primary use case), and follow that up by additional (non-interactive) tests afterwards to check on the state of things.
Your Environment
0.14.2
and0.6.2
(pre-regression)The text was updated successfully, but these errors were encountered: