[xharness] Get the INCLUDE_ make variables and disable tests accordingly. (#1578)
This commit is contained in:
Родитель
92659752df
Коммит
c0c1136d70
|
@ -68,7 +68,10 @@ namespace xharness
|
|||
public string MONO_PATH { get; set; } // Use same name as in Makefiles, so that a grep finds it.
|
||||
public string WATCH_MONO_PATH { get; set; } // Use same name as in Makefiles, so that a grep finds it.
|
||||
public string TVOS_MONO_PATH { get; set; } // Use same name as in Makefiles, so that a grep finds it.
|
||||
public bool INCLUDE_IOS { get; set; }
|
||||
public bool INCLUDE_TVOS { get; set; }
|
||||
public bool INCLUDE_WATCH { get; set; }
|
||||
public bool INCLUDE_MAC { get; set; }
|
||||
public string JENKINS_RESULTS_DIRECTORY { get; set; } // Use same name as in Makefiles, so that a grep finds it.
|
||||
public string MAC_DESTDIR { get; set; }
|
||||
public string IOS_DESTDIR { get; set; }
|
||||
|
@ -235,8 +238,11 @@ namespace xharness
|
|||
MONO_PATH = Path.GetFullPath (Path.Combine (src_root, "external", "mono"));
|
||||
WATCH_MONO_PATH = make_config ["WATCH_MONO_PATH"];
|
||||
TVOS_MONO_PATH = MONO_PATH;
|
||||
INCLUDE_WATCH = make_config.ContainsKey ("INCLUDE_WATCH") && !string.IsNullOrEmpty (make_config ["INCLUDE_WATCH"]);
|
||||
INCLUDE_IOS = make_config.ContainsKey ("INCLUDE_IOS") && !string.IsNullOrEmpty (make_config ["INCLUDE_IOS"]);
|
||||
INCLUDE_TVOS = make_config.ContainsKey ("INCLUDE_TVOS") && !string.IsNullOrEmpty (make_config ["INCLUDE_TVOS"]);
|
||||
JENKINS_RESULTS_DIRECTORY = make_config ["JENKINS_RESULTS_DIRECTORY"];
|
||||
INCLUDE_WATCH = make_config.ContainsKey ("INCLUDE_WATCH") && !string.IsNullOrEmpty (make_config ["INCLUDE_WATCH"]);
|
||||
INCLUDE_MAC = make_config.ContainsKey ("INCLUDE_MAC") && !string.IsNullOrEmpty (make_config ["INCLUDE_MAC"]);
|
||||
MAC_DESTDIR = make_config ["MAC_DESTDIR"];
|
||||
IOS_DESTDIR = make_config ["IOS_DESTDIR"];
|
||||
}
|
||||
|
|
|
@ -208,17 +208,38 @@ namespace xharness
|
|||
{
|
||||
int pull_request;
|
||||
|
||||
if (!int.TryParse (Environment.GetEnvironmentVariable ("ghprbPullId"), out pull_request)) {
|
||||
if (!int.TryParse (Environment.GetEnvironmentVariable ("ghprbPullId"), out pull_request))
|
||||
MainLog.WriteLine ("The environment variable 'ghprbPullId' was not found, so no pull requests will be checked for test selection.");
|
||||
return;
|
||||
}
|
||||
|
||||
// First check if can auto-select any tests based on which files were modified.
|
||||
// This will only enable additional tests, never disable tests.
|
||||
if (pull_request > 0)
|
||||
SelectTestsByModifiedFiles (pull_request);
|
||||
|
||||
// Then we check for labels. Labels are manually set, so those override
|
||||
// whatever we did automatically.
|
||||
if (pull_request > 0)
|
||||
SelectTestsByLabel (pull_request);
|
||||
|
||||
if (!Harness.INCLUDE_IOS) {
|
||||
MainLog.WriteLine ("The iOS build is diabled, so any iOS tests will be disabled as well.");
|
||||
IncludeiOS = false;
|
||||
}
|
||||
|
||||
if (!Harness.INCLUDE_WATCH) {
|
||||
MainLog.WriteLine ("The watchOS build is disabled, so any watchOS tests will be disabled as well.");
|
||||
IncludewatchOS = false;
|
||||
}
|
||||
|
||||
if (!Harness.INCLUDE_TVOS) {
|
||||
MainLog.WriteLine ("The tvOS build is disabled, so any tvOS tests will be disabled as well.");
|
||||
IncludetvOS = false;
|
||||
}
|
||||
|
||||
if (!Harness.INCLUDE_MAC) {
|
||||
MainLog.WriteLine ("The macOS build is disabled, so any macOS tests will be disabled as well.");
|
||||
IncludeMac = false;
|
||||
}
|
||||
}
|
||||
|
||||
void SelectTestsByModifiedFiles (int pull_request)
|
||||
|
|
Загрузка…
Ссылка в новой задаче