Commit Graph

12 Commits

Author SHA1 Message Date
dundargoc
052498ed42 test: improve test conventions
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.

Closes https://github.com/neovim/neovim/issues/27004.
2024-04-23 18:17:04 +02:00
Lewis Russell
81fc27124b refactor(test): inject after_each differently 2024-04-10 15:53:50 +01:00
dundargoc
7035125b2b test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
2024-04-08 22:51:00 +02:00
Justin M. Keyes
04f2f864e2 refactor: format test/* 2024-01-03 02:09:29 +01:00
Justin M. Keyes
4fb48c5654
feat(server): set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009
PROBLEM
------------------------------------------------------------------------
$NVIM_LISTEN_ADDRESS has conflicting purposes as both a parameter ("the
current process should listen on this address") and a descriptor ("the
current process is a child of this address").

This contradiction means the presence of NVIM_LISTEN_ADDRESS is
ambiguous, so child Nvim always tries to listen on its _parent's_
socket. This is the cause of lots of  "Failed to start server" spam in
our test/CI logs:

    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-4480-0
    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-2168-0

SOLUTION
------------------------------------------------------------------------

1. Set $NVIM to the parent v:servername, *only* in child processes.
   - Now the correct way to detect a "parent" Nvim is to check for $NVIM.
2. Do NOT set $NVIM_LISTEN_ADDRESS in child processes.
3. On startup if $NVIM_LISTEN_ADDRESS exists, unset it immediately after
   server init.
4. Open a channel to parent automatically, expose it as v:parent.

Fixes #3118
Fixes #6764
Fixes #9336
Ref https://github.com/neovim/neovim/pull/8247#issuecomment-380275696
Ref #8696
2022-05-03 06:08:35 -07:00
Daniel Hahler
b3686b1597 system(), jobstart(): raise error on non-executable #11234
* tv_to_argv: error when cmd is not executable
  Callers always assume that emsg was emitted:
  - https://github.com/neovim/neovim/blob/57fbf288/src/nvim/eval.c#L12509
  - https://github.com/neovim/neovim/blob/57fbf288/src/nvim/eval.c#L17923
  - https://github.com/neovim/neovim/blob/57fbf288/src/nvim/eval.c#L18202
* test/functional/provider: display reason from missing_provider
* provider#node#Detect: skip / handle non-existing node executable
2019-12-24 07:53:56 +01:00
Jan Edmund Lazo
f274b84e1e test: give more time for nodejs
Link neovim package to project root directory.
Increase delay to 3 seconds.
Reduce the total lines in temporary node scripts.
2018-06-04 19:42:28 -04:00
Justin M. Keyes
efb6caa39b test: nodejs_spec: fix test after upstream API change
closes https://github.com/neovim/node-client/issues/72
2018-05-15 00:03:21 +02:00
Justin M. Keyes
1dc497398e test: nodejs_spec: allow more time for nodejs init 2018-04-18 09:42:56 +02:00
Justin M. Keyes
103ff26c0a provider/nodejs: check version in Detect() 2017-12-17 16:09:18 +01:00
Jan Edmund Lazo
5b692124cc test: remove inspect test; set NODE_PATH in nodejs_spec.lua
provider#node#can_inspect will fail on some systems because it is common
to have old node versions in OS (any Linux OS that has LTS releases)
and CI (Travis, Appveyor).

NODE_PATH can be trivially set with VimL.
Build scripts don't have to set it for the nodejs tests to work.
NODE_PATH is optional to begin with and is used only as a workaround
for the neovim node.js host.
2017-12-17 16:09:18 +01:00
Jan Edmund Lazo
a1adfdc7d5 ci: nodejs client acceptance-test #7706
ci: install nodejs 8 in Appveyor, Travis

provider: check node version for debug support
Resolve https://github.com/neovim/neovim/pull/7577#issuecomment-350590592 for Unix.

provider: test if nodejs in ci supports --inspect-brk

nodejs host for neovim requires nodejs 6+ to work properly.
nodejs 6.12+ or 7.6+ is required for debug support via `node --inspect-brk`.

provider: run cli.js of nodejs host directly

npm shims are useless because the user cannot set node to debug mode via
--inspect-brk. This is problematic on Windows which use batchfiles and
shell scripts to compensate for not supporting shebang.

The patch uses `npm root -g` to get the absolute path of the global npm
modules. If that fails, then the user did not install neovim npm package
globally. Use that absolute path to find `neovim/bin/cli.js`, which is
what the npm shim actually runs with node. glob() is for a simple file
check in case bin/ is removed because the npm shims are ignored now.
2017-12-17 16:09:18 +01:00