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
Workaround windows test failures due to shell quoting issues #497
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes tests when run on windows by checking the CWD of the resolved path for its volume in addition to the dir-sep.
On windows this would previously write a string with \r\n instead of \n.
Since we can easily rewrite this without spaces, and it is the only test failing in this file on windows, we'll fix it in this unconventional manner.
On windows a file cannot be deleted while a filehandle to it is open.
Avoid using spaces and quotes with `perl6 -e ...` to workaround quoting issues.
On windows the extra quoting causes test failures, ultimately turning the argument `2` into something like `\\"2\\"`. This gets rid of the extra quoting unless the argument would seem to require it, this allowing more tests to pass ( even if its not perfect ).
* Make sure to close .out so the handle can be used later. * Avoid using | in `run 'perl6', '-e', '...'` code, as it was being treated as a shell pipe on windows instead of perl6 code.
Testing shell/run differences is better handled elsewhere (and is) so only testing against run should be fine. The reason for this is libuv argument escaping makes it impossible to write a command that will work for run AND shell on both windows AND non-windows.
Fixes all but 1 S06-other/main-usage.t test on windows
`run` doesn't have access to all the commands `shell` does on windows since shell launches with `cmd /c`. This fixes this test on windows.
Usually quoting issues on windows can be avoided by using `run`, but since this test uses a pipe `|` between 2 commands ( and :in($proc.out) doesn't work on windows yet ) we must use shell. So tweak the command to use quotes on non-windows ( which can't otherwise deal with the parens ) and no quotes on windows ( which are not needed since no spaces are used ).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The main change is to use
run
instead ofis_run
when spaces need to be in an argument, sinceis_run
usesshell
( andshell
has quoting gremlins on windows ). There are some other workarounds/tweaks used as needed, but the spirit of any changed test should remain.