-
-
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
[Windows] Aruba doesn't know how to run "built-in" DOS commands #568
Comments
#521 seems to be related. |
I've been able to put together a fix to get Scenario: Changing to a directory on Windows
Given a directory named "test.d"
When I run `cd test.d` <--- this will spawn a new `cmd.exe` process with the `/c` flag and terminate on completion.
And I run `cd` <--- this will show the directory where the user was _before_ changing to `test.d`
.... I don't think we'll be able to use cmd with the Combining both the |
I was just thinking about this again.. Perhaps if we somehow changed Aruba's "context" such that, on Windows, it runs within a single command prompt instance which aborts on scenario completion? Or at some other trigger, so that we're not tightly coupling things? To be clear, if we were to do this, processes executed by Aruba would be executed from within the "master" command prompt process. I.e.
The other option I've thought of is mapping commands directly to their ruby alternative ( Do you guys have any thoughts? @olleolleolle, @mvz, @aslakhellesoy |
It looks like this is a limitation of I'll have a play around to see if I can work around this. If not, I may have to look upstream. :) |
What happens if you run the scenario with |
Another thing that I'm wondering about is: How do people developing a gem with an executable on Windows invoke said executable while developing? Knowing this may help in coming up with a reasonable scenario. |
Excellent catch there, @mvz! I've just double checked this and can confirm that you're correct. When transposing an existing feature to be Windows-compatible, it seems I misread |
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. |
I'm going to close this off, as it has been included as part of #505 |
Re-opening since #505 hasn't been fully merged yet. |
Summary
On Windows, as on Linux, Aruba knows how to handle running applications that are in the user's PATH environment variable, however unlike on Linux it doesn't know how to run commands built-in to the command prompt, such as
cd
andecho
. This most likely works on Unix due tocd
andecho
being executables in their own right.Expected Behavior
should echo
\tmp\aruba\test_directory
to the console.Current Behavior
Currently, when you run
cd
orecho
from Aruba on Windows, it fails with the stacktrace below.Possible Solution
I was thinking of updating
lib/aruba/processes/windows_which.rb
to "map" built-in DOS commands such asecho
andcd
(without arguments) such that it returns the command prefixed with the path tocmd.exe
and the/c
argument. e.g. `C:\windows\system32\cmd.exe /c "echo {additional_args}".I suspect this may become very messy, however, especially when the user wants to pass multiple arguments.
Steps to Reproduce (for bugs)
cucumber /path/to/feature
on a Windows machine.Context & Motivation
I was trying to fix up the AppVeyor build without negatively impacting our Windows-based test coverage and ran into this when creating alternative, Windows-specific scenarios using
cd
orecho %cd%
.Your Environment
master
soon.The text was updated successfully, but these errors were encountered: