test: isCI(): add "name" parameter

This commit is contained in:
Justin M. Keyes
2019-08-05 03:46:37 +02:00
parent c516586dc3
commit 94afc201bc
5 changed files with 12 additions and 10 deletions

View File

@@ -181,7 +181,7 @@ describe('server -> client', function()
end) end)
describe('recursive (child) nvim client', function() describe('recursive (child) nvim client', function()
if os.getenv("TRAVIS") and helpers.os_name() == "osx" then if helpers.isCI('travis') and helpers.os_name() == 'osx' then
-- XXX: Hangs Travis macOS since e9061117a5b8f195c3f26a5cb94e18ddd7752d86. -- XXX: Hangs Travis macOS since e9061117a5b8f195c3f26a5cb94e18ddd7752d86.
pending("[Hangs on Travis macOS. #5002]", function() end) pending("[Hangs on Travis macOS. #5002]", function() end)
return return
@@ -340,7 +340,7 @@ describe('server -> client', function()
describe('connecting to its own pipe address', function() describe('connecting to its own pipe address', function()
it('does not deadlock', function() it('does not deadlock', function()
if not os.getenv("TRAVIS") and helpers.os_name() == "osx" then if not helpers.isCI('travis') and helpers.os_name() == 'osx' then
-- It does, in fact, deadlock on QuickBuild. #6851 -- It does, in fact, deadlock on QuickBuild. #6851
pending("deadlocks on QuickBuild", function() end) pending("deadlocks on QuickBuild", function() end)
return return

View File

@@ -205,7 +205,7 @@ describe('jobs', function()
end) end)
it("will not buffer data if it doesn't end in newlines", function() it("will not buffer data if it doesn't end in newlines", function()
if os.getenv("TRAVIS") and os.getenv("CC") == "gcc-4.9" if helpers.isCI('travis') and os.getenv('CC') == 'gcc-4.9'
and helpers.os_name() == "osx" then and helpers.os_name() == "osx" then
-- XXX: Hangs Travis macOS since e9061117a5b8f195c3f26a5cb94e18ddd7752d86. -- XXX: Hangs Travis macOS since e9061117a5b8f195c3f26a5cb94e18ddd7752d86.
pending("[Hangs on Travis macOS. #5002]", function() end) pending("[Hangs on Travis macOS. #5002]", function() end)

View File

@@ -11,7 +11,7 @@ describe("CTRL-C (mapped)", function()
it("interrupts :global", function() it("interrupts :global", function()
-- Crashes luajit. -- Crashes luajit.
if helpers.skip_fragile(pending, if helpers.skip_fragile(pending,
os.getenv("TRAVIS") or os.getenv("APPVEYOR")) then helpers.isCI('travis') or helpers.isCI('appveyor')) then
return return
end end

View File

@@ -52,7 +52,7 @@ describe("shell command :!", function()
it("throttles shell-command output greater than ~10KB", function() it("throttles shell-command output greater than ~10KB", function()
if helpers.skip_fragile(pending, if helpers.skip_fragile(pending,
(os.getenv("TRAVIS") and helpers.os_name() == "osx")) then (helpers.isCI('travis') and helpers.os_name() == 'osx')) then
return return
end end
child_session.feed_data( child_session.feed_data(

View File

@@ -674,11 +674,13 @@ function module.write_file(name, text, no_dedent, append)
file:close() file:close()
end end
function module.isCI() function module.isCI(name)
local is_travis = nil ~= os.getenv('TRAVIS') local any = (name == nil)
local is_appveyor = nil ~= os.getenv('APPVEYOR') assert(any or name == 'appveyor' or name == 'quickbuild' or name == 'travis')
local is_quickbuild = nil ~= lfs.attributes('/usr/home/quickbuild') local av = ((any or name == 'appveyor') and nil ~= os.getenv('APPVEYOR'))
return is_travis or is_appveyor or is_quickbuild local tr = ((any or name == 'travis') and nil ~= os.getenv('TRAVIS'))
local qb = ((any or name == 'quickbuild') and nil ~= lfs.attributes('/usr/home/quickbuild'))
return tr or av or qb
end end
-- Gets the contents of $NVIM_LOG_FILE for printing to the build log. -- Gets the contents of $NVIM_LOG_FILE for printing to the build log.