mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-03 17:24:29 +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
 | 
			
		||||
        -DBUILD_DIR=${CMAKE_BINARY_DIR}
 | 
			
		||||
        -DTEST_TYPE=unit
 | 
			
		||||
        -DCIRRUS_CI=$ENV{CIRRUS_CI}
 | 
			
		||||
        -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
 | 
			
		||||
      DEPENDS ${UNITTEST_PREREQS}
 | 
			
		||||
      ${TEST_TARGET_ARGS})
 | 
			
		||||
@@ -751,6 +752,7 @@ if(BUSTED_PRG)
 | 
			
		||||
      -DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
 | 
			
		||||
      -DBUILD_DIR=${CMAKE_BINARY_DIR}
 | 
			
		||||
      -DTEST_TYPE=functional
 | 
			
		||||
      -DCIRRUS_CI=$ENV{CIRRUS_CI}
 | 
			
		||||
      -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
 | 
			
		||||
    DEPENDS ${FUNCTIONALTEST_PREREQS}
 | 
			
		||||
    ${TEST_TARGET_ARGS})
 | 
			
		||||
@@ -766,6 +768,7 @@ if(BUSTED_PRG)
 | 
			
		||||
      -DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
 | 
			
		||||
      -DBUILD_DIR=${CMAKE_BINARY_DIR}
 | 
			
		||||
      -DTEST_TYPE=benchmark
 | 
			
		||||
      -DCIRRUS_CI=$ENV{CIRRUS_CI}
 | 
			
		||||
      -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
 | 
			
		||||
    DEPENDS ${BENCHMARK_PREREQS}
 | 
			
		||||
    ${TEST_TARGET_ARGS})
 | 
			
		||||
@@ -783,6 +786,7 @@ if(BUSTED_LUA_PRG)
 | 
			
		||||
      -DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
 | 
			
		||||
      -DBUILD_DIR=${CMAKE_BINARY_DIR}
 | 
			
		||||
      -DTEST_TYPE=functional
 | 
			
		||||
      -DCIRRUS_CI=$ENV{CIRRUS_CI}
 | 
			
		||||
      -P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
 | 
			
		||||
    DEPENDS ${FUNCTIONALTEST_PREREQS}
 | 
			
		||||
    ${TEST_TARGET_ARGS})
 | 
			
		||||
 
 | 
			
		||||
@@ -3,8 +3,8 @@ set(ENV{LC_ALL} "en_US.UTF-8")
 | 
			
		||||
 | 
			
		||||
if(POLICY CMP0012)
 | 
			
		||||
  # 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
 | 
			
		||||
  # the cmake script mode (-P).
 | 
			
		||||
  # project has already set this policy as project settings aren't inherited
 | 
			
		||||
  # when using cmake script mode (-P).
 | 
			
		||||
  cmake_policy(SET CMP0012 NEW)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
@@ -15,6 +15,12 @@ set(ENV{XDG_DATA_HOME} ${BUILD_DIR}/Xtest_xdg/share)
 | 
			
		||||
unset(ENV{XDG_DATA_DIRS})
 | 
			
		||||
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})
 | 
			
		||||
  set(ENV{NVIM_LOG_FILE} ${BUILD_DIR}/.nvimlog)
 | 
			
		||||
endif()
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,6 @@ local exec_lua = helpers.exec_lua
 | 
			
		||||
local retry = helpers.retry
 | 
			
		||||
local isCI = helpers.isCI
 | 
			
		||||
local assert_alive = helpers.assert_alive
 | 
			
		||||
local uname = helpers.uname
 | 
			
		||||
 | 
			
		||||
describe('notify', function()
 | 
			
		||||
  local channel
 | 
			
		||||
@@ -79,9 +78,6 @@ describe('notify', function()
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  it('cancels stale events on channel close', function()
 | 
			
		||||
    if uname() == 'freebsd' then
 | 
			
		||||
      pending('Failing FreeBSD test')
 | 
			
		||||
    end
 | 
			
		||||
    if isCI() then
 | 
			
		||||
      pending('hangs on CI #14083 #15251')
 | 
			
		||||
      return
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@ 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
 | 
			
		||||
local isCI = helpers.isCI
 | 
			
		||||
 | 
			
		||||
describe('fileio', function()
 | 
			
		||||
  before_each(function()
 | 
			
		||||
@@ -87,8 +87,8 @@ describe('fileio', function()
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  it('backup #9709', function()
 | 
			
		||||
    if uname() == 'freebsd' then
 | 
			
		||||
      pending('Failing FreeBSD test')
 | 
			
		||||
    if isCI('cirrus') then
 | 
			
		||||
      pending('FIXME: cirrus')
 | 
			
		||||
    end
 | 
			
		||||
    clear({ args={ '-i', 'Xtest_startup_shada',
 | 
			
		||||
                   '--cmd', 'set directory=Xtest_startup_swapdir' } })
 | 
			
		||||
@@ -109,8 +109,8 @@ describe('fileio', function()
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  it('backup with full path #11214', function()
 | 
			
		||||
    if uname() == 'freebsd' then
 | 
			
		||||
      pending('Failing FreeBSD test')
 | 
			
		||||
    if isCI('cirrus') then
 | 
			
		||||
      pending('FIXME: cirrus')
 | 
			
		||||
    end
 | 
			
		||||
    clear()
 | 
			
		||||
    mkdir('Xtest_backupdir')
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ local feed_command = helpers.feed_command
 | 
			
		||||
local funcs = helpers.funcs
 | 
			
		||||
local meths = helpers.meths
 | 
			
		||||
local iswin = helpers.iswin
 | 
			
		||||
local uname = helpers.uname
 | 
			
		||||
local isCI = helpers.isCI
 | 
			
		||||
 | 
			
		||||
local fname = 'Xtest-functional-ex_cmds-write'
 | 
			
		||||
local fname_bak = fname .. '~'
 | 
			
		||||
@@ -53,8 +53,8 @@ describe(':write', function()
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  it('&backupcopy=no replaces symlink with new file', function()
 | 
			
		||||
    if uname() == 'freebsd' then
 | 
			
		||||
      pending('Failing FreeBSD test')
 | 
			
		||||
    if isCI('cirrus') then
 | 
			
		||||
      pending('FIXME: cirrus')
 | 
			
		||||
    end
 | 
			
		||||
    command('set backupcopy=no')
 | 
			
		||||
    write_file('test_bkc_file.txt', 'content0')
 | 
			
		||||
@@ -95,8 +95,8 @@ describe(':write', function()
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  it('errors out correctly', function()
 | 
			
		||||
    if uname() == 'freebsd' then
 | 
			
		||||
      pending('Failing FreeBSD test')
 | 
			
		||||
    if isCI('cirrus') then
 | 
			
		||||
      pending('FIXME: cirrus')
 | 
			
		||||
    end
 | 
			
		||||
    command('let $HOME=""')
 | 
			
		||||
    eq(funcs.fnamemodify('.', ':p:h'), funcs.fnamemodify('.', ':p:h:~'))
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,7 @@ local nvim_prog = helpers.nvim_prog
 | 
			
		||||
local matches = helpers.matches
 | 
			
		||||
local write_file = helpers.write_file
 | 
			
		||||
local tmpname = helpers.tmpname
 | 
			
		||||
local isCI = helpers.isCI
 | 
			
		||||
 | 
			
		||||
clear()
 | 
			
		||||
if funcs.executable('man') == 0 then
 | 
			
		||||
@@ -160,6 +161,9 @@ describe(':Man', function()
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  it('reports non-existent man pages for absolute paths', function()
 | 
			
		||||
    if isCI('cirrus') then
 | 
			
		||||
      pending('FIXME: cirrus')
 | 
			
		||||
    end
 | 
			
		||||
    local actual_file = tmpname()
 | 
			
		||||
    -- actual_file must be an absolute path to an existent file for us to test against it
 | 
			
		||||
    matches('^/.+', actual_file)
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ local retry = helpers.retry
 | 
			
		||||
local ok = helpers.ok
 | 
			
		||||
local iswin = helpers.iswin
 | 
			
		||||
local command = helpers.command
 | 
			
		||||
local uname = helpers.uname
 | 
			
		||||
local isCI = helpers.isCI
 | 
			
		||||
 | 
			
		||||
describe(':terminal', function()
 | 
			
		||||
  local screen
 | 
			
		||||
@@ -46,8 +46,8 @@ describe(':terminal', function()
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  it("reads output buffer on terminal reporting #4151", function()
 | 
			
		||||
    if uname() == 'freebsd' then
 | 
			
		||||
      pending('Failing FreeBSD test')
 | 
			
		||||
    if isCI('cirrus') then
 | 
			
		||||
      pending('FIXME: cirrus')
 | 
			
		||||
    end
 | 
			
		||||
    if helpers.pending_win32(pending) then return end
 | 
			
		||||
    if iswin() then
 | 
			
		||||
 
 | 
			
		||||
@@ -790,10 +790,10 @@ end
 | 
			
		||||
 | 
			
		||||
function module.isCI(name)
 | 
			
		||||
  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'))
 | 
			
		||||
  return gh
 | 
			
		||||
 | 
			
		||||
  local cirrus = ((any or name == 'cirrus') and nil ~= os.getenv('CIRRUS_CI'))
 | 
			
		||||
  return gh or cirrus
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Gets the (tail) contents of `logfile`.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user