diff --git a/tests/xharness/AppRunner.cs b/tests/xharness/AppRunner.cs index 419fe54fa9..af80612458 100644 --- a/tests/xharness/AppRunner.cs +++ b/tests/xharness/AppRunner.cs @@ -532,6 +532,11 @@ namespace xharness args.Append (" -setenv=NUNIT_ENABLE_XML_MODE=wrapped"); } + if (Harness.InCI) { + // We use the 'BUILD_REVISION' variable to detect whether we're running CI or not. + args.Append ($" -setenv=BUILD_REVISION=${Environment.GetEnvironmentVariable ("BUILD_REVISION")}"); + } + if (!Harness.IncludeSystemPermissionTests) args.Append (" -setenv=DISABLE_SYSTEM_PERMISSION_TESTS=1"); diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index edd1e8eb60..42d213429d 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -689,6 +689,13 @@ namespace xharness } } + public bool InCI { + get { + // We use the 'BUILD_REVISION' variable to detect whether we're running CI or not. + return !string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("BUILD_REVISION")); + } + } + public bool UseGroupedApps { get { var groupApps = Environment.GetEnvironmentVariable ("BCL_GROUPED_APPS");