Skip to content

Conversation

janlazo
Copy link
Contributor

@janlazo janlazo commented Feb 20, 2018

Continue #7412 to resolve flaky tests in job_spec.lua.

This PR modifies shellcmdflag for powershell to remove aliases to avoid confusion such as sleep.exe (executable) and Start-Sleep (powershell built-in, doesn't accept floats).

I cannot make cat.exe reliably work on Windows. I'm considering cmd.exe to test jobsend() if there's no powershell alternative to cat.exe -. Powershell has Read-Host and $host.UI.RawUI.ReadKey() but neither work with jobsend().

-- Alternative sequence:
{ {'notification', 'stdout', {0, {'abc\ndef'} } },
{'notification', 'stdout', {0, {'', ''} } }
}
Copy link
Member

@justinmk justinmk Feb 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically we should also expect a final {'notification', 'stdout', {0, {''} } }, so in the alternative case it would have 3 chunks (I forgot to do this in one of the cases in my PR):

+      -- Alternative sequence:
+      { {'notification', 'stdout', {0, {'abc\ndef'} } },
+        {'notification', 'stdout', {0, {'', ''} } },
+        {'notification', 'stdout', {0, {''} } }
+      }

{ {'notification', '1', {'foo', 'bar', {'some text', ''}, 'stdout'} },
},
-- Alternative sequence:
{ {'notification', '1', {'foo', 'bar', {'some text'}, 'stdout'} },
Copy link
Member

@justinmk justinmk Feb 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need an extra chunk since the alternative sequence didn't see the full result in the first chunk.

-- Alternative sequence:
{ {'notification', '1', {'foo', 'bar', {'some text'}, 'stdout'},
  {'notification', '1', {'foo', 'bar', {'', ''}, 'stdout'} },

Similar for the other cases below. If we see a partial sequence, we should expect the rest in later messages.

@janlazo janlazo force-pushed the win_test_job branch 5 times, most recently from 88507b6 to 2fb33d1 Compare February 22, 2018 16:22
screen:expect([[
|
|
0|
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know where this 0 came from.

@janlazo janlazo changed the title test: win: enable more job tests [RFC] test: win: enable more job tests Feb 23, 2018
@marvim marvim added the RFC label Feb 23, 2018
@@ -14,6 +14,7 @@ local nvim_set = helpers.nvim_set
local expect_twostreams = helpers.expect_twostreams
local expect_msg_seq = helpers.expect_msg_seq
local Screen = require('test.functional.ui.screen')
local nvim_cat = iswin() and nvim_dir..'\\cat' or 'cat'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be needed. Other tests are already using cat.exe . Though maybe they were using cmd.exe instead of powershell.

Copy link
Contributor Author

@janlazo janlazo Feb 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why the flaky tests are passing. Which cat comes firsts in PATH?

@janlazo
Copy link
Contributor Author

janlazo commented Feb 24, 2018

Is make using a different cat?

@janlazo
Copy link
Contributor Author

janlazo commented Feb 24, 2018

Did something happen to libmpack-lua-1.0.7.tar.gz? I see it in https://github.com/libmpack/libmpack-lua/releases.

[00:02:02] [ 17%] Generating usr/lib/luarocks/rocks/mpack
[00:02:02] call usr\2.4\luarocks.bat build mpack CC=C:/msys64/mingw64/bin/gcc.exe LD=C:/msys64/mingw64/bin/gcc.exe
[00:02:04] 
[00:02:04] Error: Error fetching file: Failed downloading https://github.com/libmpack/libmpack-lua/releases/download/1.0.7/libmpack-lua-1.0.7.tar.gz - libmpack-lua-1.0.7.tar.gz
[00:02:04] mingw32-make[2]: *** [CMakeFiles\mpack.dir\build.make:60: usr/lib/luarocks/rocks/mpack] Error 1
[00:02:04] mingw32-make[2]: Leaving directory 'C:/projects/neovim/.deps'
[00:02:04] mingw32-make[1]: *** [CMakeFiles\Makefile2:577: CMakeFiles/mpack.dir/all] Error 2
[00:02:04] mingw32-make[1]: Leaving directory 'C:/projects/neovim/.deps'
[00:02:04] mingw32-make: *** [Makefile:83: all] Error 2

@justinmk
Copy link
Member

Luarocks server has been unreliable this week.

@janlazo
Copy link
Contributor Author

janlazo commented Feb 24, 2018

Exit code for cat.exe on Windows can be 0 or 1. Perhaps running cat.exe on the shell like in other tests solves the channel issue and unreliable exit code.

Edit:
Didn't work :(

@janlazo janlazo force-pushed the win_test_job branch 6 times, most recently from 672e9df to 48c7d23 Compare February 25, 2018 09:49
@janlazo
Copy link
Contributor Author

janlazo commented Feb 26, 2018

On my machine, luarocks install mpack fails because of wget. Is there a way for luarocks to use curl instead?

@janlazo
Copy link
Contributor Author

janlazo commented Feb 26, 2018

@janlazo
Copy link
Contributor Author

janlazo commented Feb 26, 2018

Forcing curl on luarocks requires editing C:\Program Files (x86)\LuaRocks\lua\luarocks\site_config*.lua, where wildcard is the version string.
Modify site_config.LUAROCKS_DOWNLOADER to point to the curl executable.

@justinmk
Copy link
Member

Forcing curl on luarocks requires editing C:\Program Files (x86)\LuaRocks\lua\luarocks\site_config*.lua, where wildcard is the version string

LuaRocks had planned to use curl by default long ago, but it got stalled for some reason: luarocks/luarocks#273

@hishamhm is there a way we can set site_config.LUAROCKS_DOWNLOADER without modifying the luarocks source?

@janlazo
Copy link
Contributor Author

janlazo commented Feb 26, 2018

install.bat doesn't support --with-downloader and system/user configs don't support LUAROCKS_DOWNLOADER.
Workaround for now is to edit the site_config*.lua in-place and replace [[wget]] with [[curl]].

@hishamhm
Copy link

@justinmk @janlazo we can add something similar to --with-downloader in install.bat. And yes, I'd be fine with changing the default Windows package to ship and use a curl binary -- do you recommend any we could grab that wouldn't have CRT/SSL issues? (We are severely underpowered in terms of Windows developers!)

@justinmk
Copy link
Member

justinmk commented Feb 27, 2018

do you recommend any we could grab that wouldn't have CRT/SSL issues?

@hishamhm We bundle curl.exe and ca-bundle.crt, and that seems to work well. (see 2fbc42a) These were obtained from https://winampplugins.co.uk/curl/ .

@janlazo
Copy link
Contributor Author

janlazo commented Mar 13, 2018

Closing in favor of #8120

@janlazo janlazo closed this Mar 13, 2018
@jszakmeister jszakmeister removed the RFC label Mar 13, 2018
@janlazo janlazo deleted the win_test_job branch March 13, 2018 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants