commit 15b9118ac0b6afabe821369e7a8bea8776bee416
parent 6da968dd7f9d541a83e6158f698f30f9589ae0c1
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue, 20 Jan 2026 20:56:06 +0800
test: fail CI if .nvimlog is not empty (#37470)
This will prevent adding passing tests which logs errors in .nvimlog.
Close #28323
Related: https://github.com/neovim/neovim/pull/27660#issuecomment-2035738597
Co-authored-by: dundargoc <gocdundar@gmail.com>
Diffstat:
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake
@@ -99,3 +99,12 @@ if(res)
message(FATAL_ERROR "${TEST_TYPE} tests failed with error: ${res}")
endif()
+
+if(CI_BUILD)
+ file(SIZE $ENV{NVIM_LOG_FILE} FILE_SIZE)
+ if(NOT ${FILE_SIZE} MATCHES "^0$")
+ file(READ $ENV{NVIM_LOG_FILE} out)
+ message(STATUS "$NVIM_LOG_FILE: $ENV{NVIM_LOG_FILE}\n${out}")
+ message(FATAL_ERROR "$NVIM_LOG_FILE is not empty")
+ endif()
+endif()
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
@@ -105,7 +105,7 @@ describe('jobs', function()
vim.v.progpath,
'--clean',
'--headless',
- '+lua print(vim.uv.new_tty(1, false):get_winsize())',
+ '+lua tty = vim.uv.new_tty(1, false) print(tty:get_winsize()) tty:close()',
}, {
term = true,
width = 11,
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
@@ -2804,6 +2804,7 @@ describe('TUI', function()
it('with non-tty (pipe) stdout/stderr', function()
finally(function()
os.remove('testF')
+ os.remove(testlog)
end)
local screen = tt.setup_screen(
0,
@@ -2811,16 +2812,19 @@ describe('TUI', function()
nvim_prog
),
nil,
- { VIMRUNTIME = os.getenv('VIMRUNTIME') }
+ { VIMRUNTIME = os.getenv('VIMRUNTIME'), NVIM_LOG_FILE = testlog }
)
feed_data(':w testF\n:q\n')
screen:expect([[
:w testF |
:q |
- ^ |
- |*3
+ abc |
+ |
+ [Process exited 0]^ |
+ |
{5:-- TERMINAL --} |
]])
+ assert_log('TUI: timed out waiting for DA1 response', testlog)
end)
it('<C-h> #10134', function()