From 459b81de4644106fabd410870f577848bef99fe6 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Sun, 7 Oct 2018 13:12:49 +0100 Subject: [PATCH] Use 'CI' environment variable to detect CI environment Use the 'CI' environment variable to detect CI environment, rather than a collection of CI-specific ones. --- run_cross_test.py | 2 +- run_project_tests.py | 2 +- run_tests.py | 2 +- run_unittests.py | 8 ++++---- test cases/frameworks/17 mpi/meson.build | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/run_cross_test.py b/run_cross_test.py index 71914028f..2b640ec86 100755 --- a/run_cross_test.py +++ b/run_cross_test.py @@ -38,7 +38,7 @@ def runtests(cross_file): print('\nTotal passed cross tests:', passing_tests) print('Total failed cross tests:', failing_tests) print('Total skipped cross tests:', skipped_tests) - if failing_tests > 0 and ('TRAVIS' in os.environ or 'APPVEYOR' in os.environ): + if failing_tests > 0 and ('CI' in os.environ): print('\nMesonlogs of failing tests\n') for l in failing_logs: print(l, '\n') diff --git a/run_project_tests.py b/run_project_tests.py index 876d1359a..a9c7eca7a 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -81,7 +81,7 @@ class AutoDeletedDir: failing_logs = [] print_debug = 'MESON_PRINT_TEST_OUTPUT' in os.environ -under_ci = not {'TRAVIS', 'APPVEYOR'}.isdisjoint(os.environ) +under_ci = 'CI' in os.environ do_debug = under_ci or print_debug no_meson_log_msg = 'No meson-log.txt found.' diff --git a/run_tests.py b/run_tests.py index af926eab3..242338825 100755 --- a/run_tests.py +++ b/run_tests.py @@ -245,7 +245,7 @@ if __name__ == '__main__': elif arg == '--cross=arm': cross = 'arm' # Running on a developer machine? Be nice! - if not mesonlib.is_windows() and not mesonlib.is_haiku() and 'TRAVIS' not in os.environ: + if not mesonlib.is_windows() and not mesonlib.is_haiku() and 'CI' not in os.environ: os.nice(20) # Appveyor sets the `platform` environment variable which completely messes # up building with the vs2010 and vs2015 backends. diff --git a/run_unittests.py b/run_unittests.py index 9ffce52f4..e02bc6c51 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -81,7 +81,7 @@ def is_tarball(): return False def is_ci(): - if 'TRAVIS' in os.environ or 'APPVEYOR' in os.environ: + if 'CI' in os.environ: return True return False @@ -98,8 +98,8 @@ def _git_init(project_dir): def skipIfNoPkgconfig(f): ''' - Skip this test if no pkg-config is found, unless we're on Travis or - Appveyor CI. This allows users to run our test suite without having + Skip this test if no pkg-config is found, unless we're on CI. + This allows users to run our test suite without having pkg-config installed on, f.ex., macOS, while ensuring that our CI does not silently skip the test because of misconfiguration. @@ -1671,7 +1671,7 @@ class AllPlatformTests(BasePlatformTests): self.assertIsInstance(linker, lib) self.assertEqual(cc.id, 'msvc') self.assertTrue(hasattr(cc, 'is_64')) - # If we're in the appveyor CI, we know what the compiler will be + # If we're on Windows CI, we know what the compiler will be if 'arch' in os.environ: if os.environ['arch'] == 'x64': self.assertTrue(cc.is_64) diff --git a/test cases/frameworks/17 mpi/meson.build b/test cases/frameworks/17 mpi/meson.build index 1085d40c8..b2f9fb853 100644 --- a/test cases/frameworks/17 mpi/meson.build +++ b/test cases/frameworks/17 mpi/meson.build @@ -17,7 +17,7 @@ exec = executable('exec', test('MPI C', exec) if build_machine.system() != 'windows' - # C++ MPI not supported by MS-MPI used on AppVeyor. + # C++ MPI not supported by MS-MPI mpicpp = dependency('mpi', language : 'cpp') execpp = executable('execpp', 'main.cpp',