Skip to content
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
merged 16 commits into from Nov 14, 2018
Merged

Workaround windows test failures due to shell quoting issues #497

merged 16 commits into from Nov 14, 2018

Conversation

ugexe
Copy link
Contributor

@ugexe ugexe commented Nov 14, 2018

The main change is to use run instead of is_run when spaces need to be in an argument, since is_run uses shell ( and shell has quoting gremlins on windows ). There are some other workarounds/tweaks used as needed, but the spirit of any changed test should remain.

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 ).
@ugexe ugexe merged commit f92a492 into Raku:master Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant