[WIP] Add support for common Windows commands #569
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
On Windows, as on Linux, Aruba knows how to handle running applications that are in the user's PATH environment variable. Unlike on Linux, however, some windows commands (such as
echo
) are built-in to the command prompt and are not standalone executables.Currently, running
echo
from Aruba on a Windows computer will fail the scenario withCommand "echo" not found in PATH-variable
errors. This PR aims to resolve this.Details
I've added the ability to define commands that should always be prefixed with
cmd.exe /c
, ininternal_shell_commands
under each platform's class.I then check whether the command that couldn't be found in PATH is an internal shell command, and if so, bypass the call to
fail
.Aruba.platform.command_string
then kicks in and prependscmd.exe /c
as usual.Motivation and Context
The AppVeyor CI builds are failing on Windows as many of the scenarios are incompatible due to their use of
echo
and other commands. Rather than tag the failing scenarios with@not-supported-on-platform-windows
, which will reduce the test coverage for Windows, I figured we should look at fixing the issue and only use that tag when we really need to.Please see #568 for further information.
How Has This Been Tested?
No additional tests have been added. Instead, these changes fix some of the previously failing tests (e.g.
features/02_configure_aruba/working_directory.feature
)Screenshots (if appropriate):
Types of changes
Checklist: