mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
ci: add cirrus to isCI function to skip tests (#20526)
The environment variable CIRRUS_CI is manually passed to RunTests.cmake as it doesn't get passed when using cmake script mode.
This commit is contained in:
@@ -721,6 +721,7 @@ if(BUSTED_PRG)
|
|||||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||||
-DTEST_TYPE=unit
|
-DTEST_TYPE=unit
|
||||||
|
-DCIRRUS_CI=$ENV{CIRRUS_CI}
|
||||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||||
DEPENDS ${UNITTEST_PREREQS}
|
DEPENDS ${UNITTEST_PREREQS}
|
||||||
${TEST_TARGET_ARGS})
|
${TEST_TARGET_ARGS})
|
||||||
@@ -751,6 +752,7 @@ if(BUSTED_PRG)
|
|||||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||||
-DTEST_TYPE=functional
|
-DTEST_TYPE=functional
|
||||||
|
-DCIRRUS_CI=$ENV{CIRRUS_CI}
|
||||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||||
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
||||||
${TEST_TARGET_ARGS})
|
${TEST_TARGET_ARGS})
|
||||||
@@ -766,6 +768,7 @@ if(BUSTED_PRG)
|
|||||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||||
-DTEST_TYPE=benchmark
|
-DTEST_TYPE=benchmark
|
||||||
|
-DCIRRUS_CI=$ENV{CIRRUS_CI}
|
||||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||||
DEPENDS ${BENCHMARK_PREREQS}
|
DEPENDS ${BENCHMARK_PREREQS}
|
||||||
${TEST_TARGET_ARGS})
|
${TEST_TARGET_ARGS})
|
||||||
@@ -783,6 +786,7 @@ if(BUSTED_LUA_PRG)
|
|||||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||||
-DTEST_TYPE=functional
|
-DTEST_TYPE=functional
|
||||||
|
-DCIRRUS_CI=$ENV{CIRRUS_CI}
|
||||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||||
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
||||||
${TEST_TARGET_ARGS})
|
${TEST_TARGET_ARGS})
|
||||||
|
@@ -3,8 +3,8 @@ set(ENV{LC_ALL} "en_US.UTF-8")
|
|||||||
|
|
||||||
if(POLICY CMP0012)
|
if(POLICY CMP0012)
|
||||||
# Avoid policy warning due to CI=true. This is needed even if the main
|
# Avoid policy warning due to CI=true. This is needed even if the main
|
||||||
# project has already set this policy as policy settings are reset when using
|
# project has already set this policy as project settings aren't inherited
|
||||||
# the cmake script mode (-P).
|
# when using cmake script mode (-P).
|
||||||
cmake_policy(SET CMP0012 NEW)
|
cmake_policy(SET CMP0012 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -15,6 +15,12 @@ set(ENV{XDG_DATA_HOME} ${BUILD_DIR}/Xtest_xdg/share)
|
|||||||
unset(ENV{XDG_DATA_DIRS})
|
unset(ENV{XDG_DATA_DIRS})
|
||||||
unset(ENV{NVIM}) # Clear $NVIM in case tests are running from Nvim. #11009
|
unset(ENV{NVIM}) # Clear $NVIM in case tests are running from Nvim. #11009
|
||||||
|
|
||||||
|
# TODO(dundargoc): The CIRRUS_CI environment variable isn't passed to here from
|
||||||
|
# the main CMakeLists.txt, so we have to manually pass it to this script and
|
||||||
|
# re-set the environment variable. Investigate if we can avoid manually setting
|
||||||
|
# it like with the GITHUB_CI environment variable.
|
||||||
|
set(ENV{CIRRUS_CI} ${CIRRUS_CI})
|
||||||
|
|
||||||
if(NOT DEFINED ENV{NVIM_LOG_FILE})
|
if(NOT DEFINED ENV{NVIM_LOG_FILE})
|
||||||
set(ENV{NVIM_LOG_FILE} ${BUILD_DIR}/.nvimlog)
|
set(ENV{NVIM_LOG_FILE} ${BUILD_DIR}/.nvimlog)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -7,7 +7,6 @@ local exec_lua = helpers.exec_lua
|
|||||||
local retry = helpers.retry
|
local retry = helpers.retry
|
||||||
local isCI = helpers.isCI
|
local isCI = helpers.isCI
|
||||||
local assert_alive = helpers.assert_alive
|
local assert_alive = helpers.assert_alive
|
||||||
local uname = helpers.uname
|
|
||||||
|
|
||||||
describe('notify', function()
|
describe('notify', function()
|
||||||
local channel
|
local channel
|
||||||
@@ -79,9 +78,6 @@ describe('notify', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('cancels stale events on channel close', function()
|
it('cancels stale events on channel close', function()
|
||||||
if uname() == 'freebsd' then
|
|
||||||
pending('Failing FreeBSD test')
|
|
||||||
end
|
|
||||||
if isCI() then
|
if isCI() then
|
||||||
pending('hangs on CI #14083 #15251')
|
pending('hangs on CI #14083 #15251')
|
||||||
return
|
return
|
||||||
|
@@ -25,7 +25,7 @@ local expect_exit = helpers.expect_exit
|
|||||||
local write_file = helpers.write_file
|
local write_file = helpers.write_file
|
||||||
local Screen = require('test.functional.ui.screen')
|
local Screen = require('test.functional.ui.screen')
|
||||||
local feed_command = helpers.feed_command
|
local feed_command = helpers.feed_command
|
||||||
local uname = helpers.uname
|
local isCI = helpers.isCI
|
||||||
|
|
||||||
describe('fileio', function()
|
describe('fileio', function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
@@ -87,8 +87,8 @@ describe('fileio', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('backup #9709', function()
|
it('backup #9709', function()
|
||||||
if uname() == 'freebsd' then
|
if isCI('cirrus') then
|
||||||
pending('Failing FreeBSD test')
|
pending('FIXME: cirrus')
|
||||||
end
|
end
|
||||||
clear({ args={ '-i', 'Xtest_startup_shada',
|
clear({ args={ '-i', 'Xtest_startup_shada',
|
||||||
'--cmd', 'set directory=Xtest_startup_swapdir' } })
|
'--cmd', 'set directory=Xtest_startup_swapdir' } })
|
||||||
@@ -109,8 +109,8 @@ describe('fileio', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('backup with full path #11214', function()
|
it('backup with full path #11214', function()
|
||||||
if uname() == 'freebsd' then
|
if isCI('cirrus') then
|
||||||
pending('Failing FreeBSD test')
|
pending('FIXME: cirrus')
|
||||||
end
|
end
|
||||||
clear()
|
clear()
|
||||||
mkdir('Xtest_backupdir')
|
mkdir('Xtest_backupdir')
|
||||||
|
@@ -9,7 +9,7 @@ local feed_command = helpers.feed_command
|
|||||||
local funcs = helpers.funcs
|
local funcs = helpers.funcs
|
||||||
local meths = helpers.meths
|
local meths = helpers.meths
|
||||||
local iswin = helpers.iswin
|
local iswin = helpers.iswin
|
||||||
local uname = helpers.uname
|
local isCI = helpers.isCI
|
||||||
|
|
||||||
local fname = 'Xtest-functional-ex_cmds-write'
|
local fname = 'Xtest-functional-ex_cmds-write'
|
||||||
local fname_bak = fname .. '~'
|
local fname_bak = fname .. '~'
|
||||||
@@ -53,8 +53,8 @@ describe(':write', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('&backupcopy=no replaces symlink with new file', function()
|
it('&backupcopy=no replaces symlink with new file', function()
|
||||||
if uname() == 'freebsd' then
|
if isCI('cirrus') then
|
||||||
pending('Failing FreeBSD test')
|
pending('FIXME: cirrus')
|
||||||
end
|
end
|
||||||
command('set backupcopy=no')
|
command('set backupcopy=no')
|
||||||
write_file('test_bkc_file.txt', 'content0')
|
write_file('test_bkc_file.txt', 'content0')
|
||||||
@@ -95,8 +95,8 @@ describe(':write', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('errors out correctly', function()
|
it('errors out correctly', function()
|
||||||
if uname() == 'freebsd' then
|
if isCI('cirrus') then
|
||||||
pending('Failing FreeBSD test')
|
pending('FIXME: cirrus')
|
||||||
end
|
end
|
||||||
command('let $HOME=""')
|
command('let $HOME=""')
|
||||||
eq(funcs.fnamemodify('.', ':p:h'), funcs.fnamemodify('.', ':p:h:~'))
|
eq(funcs.fnamemodify('.', ':p:h'), funcs.fnamemodify('.', ':p:h:~'))
|
||||||
|
@@ -8,6 +8,7 @@ local nvim_prog = helpers.nvim_prog
|
|||||||
local matches = helpers.matches
|
local matches = helpers.matches
|
||||||
local write_file = helpers.write_file
|
local write_file = helpers.write_file
|
||||||
local tmpname = helpers.tmpname
|
local tmpname = helpers.tmpname
|
||||||
|
local isCI = helpers.isCI
|
||||||
|
|
||||||
clear()
|
clear()
|
||||||
if funcs.executable('man') == 0 then
|
if funcs.executable('man') == 0 then
|
||||||
@@ -160,6 +161,9 @@ describe(':Man', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('reports non-existent man pages for absolute paths', function()
|
it('reports non-existent man pages for absolute paths', function()
|
||||||
|
if isCI('cirrus') then
|
||||||
|
pending('FIXME: cirrus')
|
||||||
|
end
|
||||||
local actual_file = tmpname()
|
local actual_file = tmpname()
|
||||||
-- actual_file must be an absolute path to an existent file for us to test against it
|
-- actual_file must be an absolute path to an existent file for us to test against it
|
||||||
matches('^/.+', actual_file)
|
matches('^/.+', actual_file)
|
||||||
|
@@ -10,7 +10,7 @@ local retry = helpers.retry
|
|||||||
local ok = helpers.ok
|
local ok = helpers.ok
|
||||||
local iswin = helpers.iswin
|
local iswin = helpers.iswin
|
||||||
local command = helpers.command
|
local command = helpers.command
|
||||||
local uname = helpers.uname
|
local isCI = helpers.isCI
|
||||||
|
|
||||||
describe(':terminal', function()
|
describe(':terminal', function()
|
||||||
local screen
|
local screen
|
||||||
@@ -46,8 +46,8 @@ describe(':terminal', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it("reads output buffer on terminal reporting #4151", function()
|
it("reads output buffer on terminal reporting #4151", function()
|
||||||
if uname() == 'freebsd' then
|
if isCI('cirrus') then
|
||||||
pending('Failing FreeBSD test')
|
pending('FIXME: cirrus')
|
||||||
end
|
end
|
||||||
if helpers.pending_win32(pending) then return end
|
if helpers.pending_win32(pending) then return end
|
||||||
if iswin() then
|
if iswin() then
|
||||||
|
@@ -790,10 +790,10 @@ end
|
|||||||
|
|
||||||
function module.isCI(name)
|
function module.isCI(name)
|
||||||
local any = (name == nil)
|
local any = (name == nil)
|
||||||
assert(any or name == 'github')
|
assert(any or name == 'github' or name == 'cirrus')
|
||||||
local gh = ((any or name == 'github') and nil ~= os.getenv('GITHUB_ACTIONS'))
|
local gh = ((any or name == 'github') and nil ~= os.getenv('GITHUB_ACTIONS'))
|
||||||
return gh
|
local cirrus = ((any or name == 'cirrus') and nil ~= os.getenv('CIRRUS_CI'))
|
||||||
|
return gh or cirrus
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Gets the (tail) contents of `logfile`.
|
-- Gets the (tail) contents of `logfile`.
|
||||||
|
Reference in New Issue
Block a user