From 2d6735d8cecc587eb5549f65260ee9ddeb8e1d78 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Fri, 9 Sep 2022 00:12:42 +0200 Subject: ci: move BSD jobs from sourcehut to Cirrus CI #19616 dispatch.sr.ht is being deprecated, meaning that using sourcehut CI won't be possible (see https://github.com/neovim/neovim/issues/19609). Since Github Actions doesn't provide any BSD runners an external service is required and Cirrus CI seems like a good replacement for sourcehut. Initially experimented with using FreeBSD and OpenBSD virtual machines in GitHub Actions, but Cirrus has been a much better fit with better performance, logs and overall experience. Failing tests are automatically skipped on FreeBSD regardless if it's on CI or not. Ideally these tests should only be skipped in CI with the help of `isCI` helper function. Unfortunately, the tests don't recognize the environment variable CIRRUS_CI even if it's set manually. This workaround is good enough for the time being, but we might want to only skip tests when using the CI (or even better, fix the failing tests). Closes: https://github.com/neovim/neovim/issues/19609 --- test/functional/core/fileio_spec.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/functional/core') diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua index a4d22685e8..e71131dcf8 100644 --- a/test/functional/core/fileio_spec.lua +++ b/test/functional/core/fileio_spec.lua @@ -23,6 +23,7 @@ local iswin = helpers.iswin local assert_alive = helpers.assert_alive local expect_exit = helpers.expect_exit local write_file = helpers.write_file +local uname = helpers.uname describe('fileio', function() before_each(function() @@ -83,6 +84,9 @@ describe('fileio', function() end) it('backup #9709', function() + if uname() == 'freebsd' then + pending('Failing FreeBSD test') + end clear({ args={ '-i', 'Xtest_startup_shada', '--cmd', 'set directory=Xtest_startup_swapdir' } }) @@ -102,6 +106,9 @@ describe('fileio', function() end) it('backup with full path #11214', function() + if uname() == 'freebsd' then + pending('Failing FreeBSD test') + end clear() mkdir('Xtest_backupdir') command('set backup') -- cgit From 3c3f3e7353ba2cb9071183cd05036ca2a98d3672 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 17 Sep 2022 16:17:51 +0800 Subject: test(remote_spec): reduce flakiness in waiting for client exit (#20230) It is less likely for client to exit between jobstart() and jobwait() if they are invoked in the same RPC request instead of two separate ones. --- test/functional/core/remote_spec.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/functional/core') diff --git a/test/functional/core/remote_spec.lua b/test/functional/core/remote_spec.lua index d7bd075eb2..846d79abf3 100644 --- a/test/functional/core/remote_spec.lua +++ b/test/functional/core/remote_spec.lua @@ -3,6 +3,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear = helpers.clear local command = helpers.command local eq = helpers.eq +local exec_lua = helpers.exec_lua local expect = helpers.expect local funcs = helpers.funcs local insert = helpers.insert @@ -48,8 +49,8 @@ describe('Remote', function() -- our incoming --remote calls. local client_starter = spawn(new_argv(), false, nil, true) set_session(client_starter) - local client_job_id = funcs.jobstart(client_argv) - eq({ 0 }, funcs.jobwait({client_job_id})) + -- Call jobstart() and jobwait() in the same RPC request to reduce flakiness. + eq({ 0 }, exec_lua([[return vim.fn.jobwait({ vim.fn.jobstart(...) })]], client_argv)) client_starter:close() set_session(server) end @@ -121,8 +122,8 @@ describe('Remote', function() -- the event loop. If the server event loop is blocked, it can't process -- our incoming --remote calls. clear() - local bogus_job_id = funcs.jobstart(bogus_argv) - eq({2}, funcs.jobwait({bogus_job_id})) + -- Call jobstart() and jobwait() in the same RPC request to reduce flakiness. + eq({ 2 }, exec_lua([[return vim.fn.jobwait({ vim.fn.jobstart(...) })]], bogus_argv)) end it('bogus subcommand', function() run_and_check_exit_code('--remote-bogus') -- cgit From 2a3cb0893b03aeff4d8c0b2116cbddda53bba5a2 Mon Sep 17 00:00:00 2001 From: Louis Sven Goulet <31444858+lorlouis@users.noreply.github.com> Date: Sat, 24 Sep 2022 21:57:10 -0400 Subject: feat: ":write!" skips "file changed" warning #18665 Problem: Cannot opt-out of "WARNING: The file has been changed since reading it!!!", even with ":write!". Solution: Change ":write!" to skip the warning. closes #7270 --- test/functional/core/fileio_spec.lua | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'test/functional/core') diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua index e71131dcf8..a589d088a4 100644 --- a/test/functional/core/fileio_spec.lua +++ b/test/functional/core/fileio_spec.lua @@ -23,6 +23,8 @@ local iswin = helpers.iswin local assert_alive = helpers.assert_alive local expect_exit = helpers.expect_exit local write_file = helpers.write_file +local Screen = require('test.functional.ui.screen') +local feed_command = helpers.feed_command local uname = helpers.uname describe('fileio', function() @@ -36,6 +38,7 @@ describe('fileio', function() os.remove('Xtest_startup_file2') os.remove('Xtest_тест.md') os.remove('Xtest-u8-int-max') + os.remove('Xtest-overwrite-forced') rmdir('Xtest_startup_swapdir') rmdir('Xtest_backupdir') end) @@ -151,6 +154,61 @@ describe('fileio', function() command('edit ++enc=utf32 Xtest-u8-int-max') assert_alive() end) + + it(':w! does not show "file has been changed" warning', function() + clear() + write_file("Xtest-overwrite-forced", 'foobar') + command('set nofixendofline') + local screen = Screen.new(40,4) + screen:set_default_attr_ids({ + [1] = {bold = true, foreground = Screen.colors.Blue1}, + [2] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red}, + [3] = {bold = true, foreground = Screen.colors.SeaGreen4} + }) + screen:attach() + command("set display-=msgsep shortmess-=F") + + command("e Xtest-overwrite-forced") + screen:expect([[ + ^foobar | + {1:~ }| + {1:~ }| + "Xtest-overwrite-forced" [noeol] 1L, 6B | + ]]) + + -- Get current unix time. + local cur_unix_time = os.time(os.date("!*t")) + local future_time = cur_unix_time + 999999 + -- Set the file's access/update time to be + -- greater than the time at which it was created. + local uv = require("luv") + uv.fs_utime('Xtest-overwrite-forced', future_time, future_time) + -- use async feed_command because nvim basically hangs on the prompt + feed_command("w") + screen:expect([[ + {2:WARNING: The file has been changed since}| + {2: reading it!!!} | + {3:Do you really want to write to it (y/n)^?}| + | + ]]) + + feed("n") + feed("") + screen:expect([[ + ^foobar | + {1:~ }| + {1:~ }| + | + ]]) + -- Use a screen test because the warning does not set v:errmsg. + command("w!") + screen:expect([[ + ^foobar | + {1:~ }| + {1:~ }| + Date: Sun, 25 Sep 2022 02:20:47 +0200 Subject: feat(gen_help_html.lua): adapt to new parser - adapt to parser changes from https://github.com/vigoux/tree-sitter-vimdoc/pull/16 - numerous other generator improvements --- test/functional/core/startup_spec.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/functional/core') diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 4f9df4010e..a32c801c97 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -354,7 +354,9 @@ describe('startup', function() local function pack_clear(cmd) -- add packages after config dir in rtp but before config/after - clear{args={'--cmd', 'set packpath=test/functional/fixtures', '--cmd', 'let paths=split(&rtp, ",")', '--cmd', 'let &rtp = paths[0]..",test/functional/fixtures,test/functional/fixtures/middle,"..join(paths[1:],",")', '--cmd', cmd}, env={XDG_CONFIG_HOME='test/functional/fixtures/'}} + clear{args={'--cmd', 'set packpath=test/functional/fixtures', '--cmd', 'let paths=split(&rtp, ",")', '--cmd', 'let &rtp = paths[0]..",test/functional/fixtures,test/functional/fixtures/middle,"..join(paths[1:],",")', '--cmd', cmd}, env={XDG_CONFIG_HOME='test/functional/fixtures/'}, + args_rm={'runtimepath'}, + } end -- cgit From 6ae144a92171cf9ae52bddddc3a081a4efaabe9f Mon Sep 17 00:00:00 2001 From: bfredl Date: Tue, 27 Sep 2022 16:19:15 +0200 Subject: feat(messages)!: graduate the 'msgsep' feature The old behaviour (e.g. via `set display-=msgsep`) will not be available. Assuming that messages always are being drawn on msg_grid (or not drawn at all, and forwarded to `ext_messages` enabled UI) will allows some simplifcations and enhancements moving forward. --- test/functional/core/fileio_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/core') diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua index a589d088a4..d1ff5b8036 100644 --- a/test/functional/core/fileio_spec.lua +++ b/test/functional/core/fileio_spec.lua @@ -166,7 +166,7 @@ describe('fileio', function() [3] = {bold = true, foreground = Screen.colors.SeaGreen4} }) screen:attach() - command("set display-=msgsep shortmess-=F") + command("set shortmess-=F") command("e Xtest-overwrite-forced") screen:expect([[ -- cgit From cfdb4cbada8c65aa57e69776bcc0f7b8b298317a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 7 Oct 2022 09:43:16 +0800 Subject: fix: find multibyte file name in line (#20519) And remove unnecessary unsigned casts in fold marker comparison. --- test/functional/core/path_spec.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/functional/core') diff --git a/test/functional/core/path_spec.lua b/test/functional/core/path_spec.lua index 669bc99136..61fae7622c 100644 --- a/test/functional/core/path_spec.lua +++ b/test/functional/core/path_spec.lua @@ -4,6 +4,8 @@ local eq = helpers.eq local eval = helpers.eval local command = helpers.command local iswin = helpers.iswin +local insert = helpers.insert +local feed = helpers.feed describe('path collapse', function() local targetdir @@ -54,3 +56,15 @@ describe('path collapse', function() eq(expected_path, eval('expand("%:p")')) end) end) + +describe('file search', function() + before_each(clear) + + it('find multibyte file name in line #20517', function() + command('cd test/functional/fixtures') + insert('filename_with_unicode_ααα') + eq('', eval('expand("%")')) + feed('gf') + eq('filename_with_unicode_ααα', eval('expand("%:t")')) + end) +end) -- cgit