unittests: fine-tune the check for whether we are in CI

The $CI environment variable may be generally set by Github or Gitlab
actions, and is not a reliable indicator of whether we are running "CI".
It could also, for an absolutely random example that didn't *just
happen*, be Alpine Linux's attempt to enable the Meson testsuite in
their packaging, which... uses Gitlab CI.

In this case, we do want to perform normal skipping on not-found
requirements. Instead of checking for $CI, check for $MESON_CI_JOBNAME
as we already use that in all of our own CI jobs for various reasons.

This makes it easier for linux distros to package Meson without
accumulating hacks like "run the testsuite using `env -u CI`".
pull/9999/head
Eli Schwartz 3 years ago committed by Nirbheek Chauhan
parent 37be39bc69
commit 4274e0f42a
  1. 1
      .github/workflows/macos.yml
  2. 2
      unittests/helpers.py

@ -35,6 +35,7 @@ jobs:
- env:
CPPFLAGS: "-I/usr/local/include"
LDFLAGS: "-L/usr/local/lib"
MESON_CI_JOBNAME: unittests-appleclang
MESON_UNIT_TEST_BACKEND: ninja
# These cannot evaluate anything, so we cannot set PATH or SDKROOT here
run: |

@ -17,7 +17,7 @@ from run_tests import get_fake_env
def is_ci():
if 'CI' in os.environ:
if 'MESON_CI_JOBNAME' in os.environ:
return True
return False

Loading…
Cancel
Save