-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Prevent duplicating stderr/stdout for run_simple
commands
#374
Comments
I see. Good that you find the reason. Let me think about that one. Maybe we should an option to silently stop a command. WDYT? |
No, I don't think that would be useful. Users don't know that the output is announced during stop. It's too low level to know about it. Just think of Ruby's backticks syntax to execute and capture output - it's simple and understandable with no options. There's no "double output" or silencing option. The same with popen and open3 - the fact that commands are stopped and streams are closed are almost invisible to the user. What should happen instead is: Aruba should provide aggregated and partial output at all times. E.g. "announce-aggregated-stdout" would be the equivalent of what it does not. For short-running "run_simple" commands, you only want the aggregate anyway. (at least until Aruba supports live/real-time output in the future output). E.g. The docker-api gem allows capturing and streaming out live output. So this is a decent fix until then. |
If a users decided to use `run_simple`, a command is stopped twice: 1. After the configured wait time 2. On the end of test suite via terminate_all_commands This makes the output appear twice. This is fixed by this PR. It also make a method call fail: 1. Command already stopped, `#stop` is called again 2. Comannd has not been started, but ist `#stop`ped
If a users decided to use `run_simple`, a command is stopped twice: 1. After the configured wait time 2. On the end of test suite via terminate_all_commands This makes the output appear twice. This is fixed by this PR. It also make a method call fail: 1. Command already stopped, `#stop` is called again 2. Comannd has not been started, but ist `#stop`ped
If a users decided to use `run_simple`, a command is stopped twice: 1. After the configured wait time 2. On the end of test suite via terminate_all_commands This makes the output appear twice. This is fixed by this PR. It also make a method call fail: 1. Command already stopped, `#stop` is called again 2. Comannd has not been started, but ist `#stop`ped
If a users decided to use `run_simple`, a command is stopped twice: 1. After the configured wait time 2. On the end of test suite via terminate_all_commands This makes the output appear twice. This is fixed by this PR. It also make a method call fail: 1. Command already stopped, `#stop` is called again 2. Comannd has not been started, but ist `#stop`ped
I've noticed this too. For example, when running
I get this: $ cucumber features/echo.feature
Feature: echo
<<-STDOUT
something
STDOUT
<<-STDOUT
something
STDOUT
<<-STDOUT
something
STDOUT
@announce-stdout
Scenario: With 'something' as input # features/echo.feature:4
When I successfully run `echo something` # aruba-0.14.1/lib/aruba/cucumber/command.rb:27
<<-STDOUT
something
STDOUT
Then the output should contain "something" # aruba-0.14.1/lib/aruba/cucumber/command.rb:159
<<-STDOUT
something
STDOUT
<<-STDOUT
something
STDOUT
1 scenario (1 passed)
2 steps (2 passed)
0m0.121s aruba 0.14.1 |
Using aruba from the
|
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. |
This was fixed in the stale branch, but is potentially still a problem in master. |
If a users decided to use `run_simple`, a command is stopped twice: 1. After the configured wait time 2. On the end of test suite via terminate_all_commands This makes the output appear twice. This is fixed by this PR. It also make a method call fail: 1. Command already stopped, `#stop` is called again 2. Comannd has not been started, but ist `#stop`ped
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. |
Waiting for #517... |
If a users decided to use `run_simple`, a command is stopped twice: 1. After the configured wait time 2. On the end of test suite via terminate_all_commands This makes the output appear twice. This is fixed by this PR. It also make a method call fail: 1. Command already stopped, `#stop` is called again 2. Comannd has not been started, but ist `#stop`ped
If a users decided to use `run_simple`, a command is stopped twice: 1. After the configured wait time 2. On the end of test suite via terminate_all_commands This makes the output appear twice. This is fixed by this PR. It also make a method call fail: 1. Command already stopped, `#stop` is called again 2. Comannd has not been started, but ist `#stop`ped
If a users decided to use `run_simple`, a command is stopped twice: 1. After the configured wait time 2. On the end of test suite via terminate_all_commands This makes the output appear twice. This is fixed by this PR. It also make a method call fail: 1. Command already stopped, `#stop` is called again 2. Comannd has not been started, but ist `#stop`ped
If a users decided to use `run_simple`, a command is stopped twice: 1. After the configured wait time 2. On the end of test suite via terminate_all_commands This makes the output appear twice. This is fixed by this PR. It also make a method call fail: 1. Command already stopped, `#stop` is called again 2. Comannd has not been started, but ist `#stop`ped
Summary
When stderr+stdout announcing is enabled for
run_simple
in RSpec, both announcements are duplicated.E.g. if a cli command outputs "hello world" in STDOUT, you'll see:
Expected Behavior
If the command is only run once, it should print each stderr/stdout announcement only once.
Current Behavior
Currently, the
stop()
call inrun_simple()
sends the notifications to announce the process's stderr+stdout. Then,stop_all_commands
does the same.Possible Solution
The sanest "workaround" for now is: just temporarily disable announcing during the
stop
in run_simple. Since the output is gathered when the process ends anyway, this isn't a problem.I implemented this in my own fork here:
e2@c540485
Ideally, there should be a way to "consume" stderr/stdout during announcements. And ideally there would be a "streaming" of stderr/stdout live while the app is running.
Steps to Reproduce (for bugs)
stdout
run_simple
with a simple 'hello world' scriptstop
insiderun_simple
, and once forstop_all_commands
when the test is done)Context
I want to see the output of commands - and it's annoying to get errors showing up multiple times on the screen. Especially annoying is having two sets of stdout+stderr. No to mention it's very confusing. (At first I though somehow the test ran twice).
Your Environment
Project without cucumber (RSpec only, standard setup with
aruba init --test-framework=rspec
).The text was updated successfully, but these errors were encountered: