Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into mono-2018-08
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed Nov 20, 2018
2 parents 5c71a9f + 50bb491 commit 74b966e
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 183 deletions.
71 changes: 38 additions & 33 deletions jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ utils = null
errorMessage = null
currentStage = null
failedStages = []
workspace = null

xiPackageFilename = null
xmPackageFilename = null
Expand Down Expand Up @@ -127,41 +128,45 @@ def reportFinalStatusToSlack (err, gitHash, currentStage, fileContents)
if ("${status}" == "SUCCESS" && err == "")
return // not reporting success to slack

def authorName = null
def authorEmail = null
if (isPr) {
authorName = env.CHANGE_AUTHOR_DISPLAY_NAME
authorEmail = env.CHANGE_AUTHOR_EMAIL
slackMessage = "Pull Request #<${env.CHANGE_URL}|${env.CHANGE_ID}> failed to build."
} else {
authorName = sh (script: "git log -1 --pretty=%an", returnStdout: true).trim ()
authorEmail = sh (script: "git log -1 --pretty=%ae", returnStdout: true).trim ()
slackMessage = "Commit <https://github.com/${repository}/commit/${gitHash}|${gitHash}> failed to build."
}
try {
def authorName = null
def authorEmail = null
if (isPr) {
authorName = env.CHANGE_AUTHOR_DISPLAY_NAME
authorEmail = env.CHANGE_AUTHOR_EMAIL
slackMessage = "Pull Request #<${env.CHANGE_URL}|${env.CHANGE_ID}> failed to build."
} else {
authorName = sh (script: "cd ${workspace} && git log -1 --pretty=%an", returnStdout: true).trim ()
authorEmail = sh (script: "cd ${workspace} && git log -1 --pretty=%ae", returnStdout: true).trim ()
slackMessage = "Commit <https://github.com/${repository}/commit/${gitHash}|${gitHash}> failed to build."
}

def title = null
if (err != null) {
title = "Internal jenkins failed in stage '${currentStage}': ${err}"
} else {
title = "Internal jenkins failed in stage '${currentStage}'"
}
def text = ""
if (fileContents != null)
text = "\"text\": ${groovy.json.JsonOutput.toJson (markdownToSlack (fileContents))},"
// The attachments string must not start with a newline, it will produce a very helpful 'Invalid JSON String' exception with no additional info.
def attachments = """[
{
\"author_name\": \"${authorName} (${authorEmail})\",
\"title\": \"${title}\",
\"title_link\": \"${env.RUN_DISPLAY_URL}\",
\"color\": \"danger\",
${text}
\"fallback\": \"Build failed\"
def title = null
if (err != null) {
title = "Internal jenkins failed in stage '${currentStage}': ${err}"
} else {
title = "Internal jenkins failed in stage '${currentStage}'"
}
]
"""
echo (attachments)
slackSend (botUser: true, channel: "#ios-notifications", color: "danger", message: slackMessage, attachments: attachments)
def text = ""
if (fileContents != null)
text = "\"text\": ${groovy.json.JsonOutput.toJson (markdownToSlack (fileContents))},"
// The attachments string must not start with a newline, it will produce a very helpful 'Invalid JSON String' exception with no additional info.
def attachments = """[
{
\"author_name\": \"${authorName} (${authorEmail})\",
\"title\": \"${title}\",
\"title_link\": \"${env.RUN_DISPLAY_URL}\",
\"color\": \"danger\",
${text}
\"fallback\": \"Build failed\"
}
]
"""
echo (attachments)
slackSend (botUser: true, channel: "#ios-notifications", color: "danger", message: slackMessage, attachments: attachments)
} catch (e) {
echo ("Failed to report to Slack: ${e}")
}
}

def reportFinalStatus (err, gitHash, currentStage)
Expand Down
1 change: 0 additions & 1 deletion src/AppKit/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public enum NSComposite : ulong {
}

[Native]
[Deprecated (PlatformName.MacOSX, 10, 14)]
public enum NSBackingStore : ulong {
[Deprecated (PlatformName.MacOSX, 10, 13, message : "Use 'Buffered' instead.")]
Retained,
Expand Down
8 changes: 3 additions & 5 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,11 @@ $(TOP)/tools/mtouch/SdkVersions.cs: $(TOP)/tools/common/SdkVersions.cs.in
@$(MAKE) -C $(TOP)/src project-files
@touch $@

.stamp-build-mono-unit-tests: $(TOP)/.git/modules/external/mono/HEAD
$(Q) $(MAKE) -C $(TOP)/external/mono/mcs/class do-test do-xunit-test PROFILE=monotouch # TODO: This should not be needed and we should get the dlls from the SDK.
nuget restore bcl-test/BCLTests/BCLTests.csproj
$(Q) touch $@

xharness/xharness.exe: $(wildcard xharness/*.cs) xharness/xharness.csproj $(TOP)/tools/mtouch/SdkVersions.cs test.config test-system.config .stamp-src-project-files
make -j8 -C $(TOP)/external/mono/mcs/class -i do-test PROFILE=MONOTOUCH # TODO: This should not be needed and we should get the dlls from the SDK.
make -j8 -C $(TOP)/external/mono/mcs/class -i do-xunit-test PROFILE=MONOTOUCH # TODO: This should not be needed and we should get the dlls from the SDK.
nuget restore xharness/xharness.csproj
nuget restore bcl-test/BCLTests/BCLTests.csproj
$(Q_GEN) $(SYSTEM_XIBUILD) -- $(MSBUILD_VERBOSITY_QUIET) xharness/xharness.csproj

killall:
Expand Down
12 changes: 3 additions & 9 deletions tests/xharness/BCLTestImporter/BCLTestImportTargetFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,16 @@ public BCLTestImportTargetFactory (Harness harness)
}

// generate all the different test targets.
public List<iOSTestProject> GetBclTargets (Harness harness)
public List<iOSTestProject> GetBclTargets ()
{
var result = new List<iOSTestProject> ();
// generate all projects, then create a new iOSTarget per project
foreach (var (name, path, xunit, platforms, generate) in projectGenerator.GenerateAllTestProjects ()) {
foreach (var (name, path, xunit, platforms) in projectGenerator.GenerateAllTestProjects ()) {
var prefix = xunit ? "xUnit" : "NUnit";
result.Add (new iOSTestProject (path) {
Name = $"[{prefix}] Mono {name}",
SkiptvOSVariation=!platforms.Contains (Platform.TvOS),
SkipwatchOSVariation=!platforms.Contains (Platform.WatchOS),
Dependency = async () => {
var rv = await harness.BuildBclTests ();
if (!rv.Succeeded)
throw new Exception ($"Failed to build BCL tests, exit code: {rv.ExitCode}. Check the harness log for more details.");
await generate ();
},
SkipwatchOSVariation=!platforms.Contains (Platform.WatchOS)
});
}
return result;
Expand Down
10 changes: 1 addition & 9 deletions tests/xharness/Harness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void AutoConfigureIOS ()

// add all the tests that are using the precompiled mono assemblies
var monoImportTestFactory = new BCLTestImportTargetFactory (this);
foreach (var target in monoImportTestFactory.GetBclTargets (this)) {
foreach (var target in monoImportTestFactory.GetBclTargets ()) {
IOSTestProjects.Add (target);
}

Expand Down Expand Up @@ -829,14 +829,6 @@ public async Task<HashSet<string>> CreateCrashReportsSnapshotAsync (Log log, boo

return rv;
}

Task<ProcessExecutionResult> build_bcl_tests;
public Task<ProcessExecutionResult> BuildBclTests ()
{
if (build_bcl_tests == null)
build_bcl_tests = ProcessHelper.ExecuteCommandAsync ("make", $".stamp-build-mono-unit-tests -C {StringUtils.Quote (Path.GetFullPath (RootDirectory))}", HarnessLog, TimeSpan.FromMinutes (30));
return build_bcl_tests;
}
}

public class CrashReportSnapshot
Expand Down
6 changes: 0 additions & 6 deletions tests/xharness/Jenkins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public Logs Logs {
public Devices Devices = new Devices ();

List<TestTask> Tasks = new List<TestTask> ();
Dictionary<string, MakeTask> DependencyTasks = new Dictionary<string, MakeTask> ();

internal static Resource DesktopResource = new Resource ("Desktop", Environment.ProcessorCount);

Expand Down Expand Up @@ -349,7 +348,6 @@ IEnumerable<TestTask> CreateRunSimulatorTasks ()
Platform = pair.Item2,
Ignored = pair.Item3,
TestName = project.Name,
Dependency = project.Dependency,
};
derived.CloneTestProject (pair.Item1);
var simTasks = CreateRunSimulatorTaskAsync (derived);
Expand Down Expand Up @@ -2208,7 +2206,6 @@ abstract class TestTask
public string ProjectPlatform;
public Dictionary<string, string> Environment = new Dictionary<string, string> ();

public Func<Task> Dependency; // a task that's feteched and awaited before this task's ExecuteAsync method
public Task InitialTask; // a task that's executed before this task's ExecuteAsync method.
public Task CompletedTask; // a task that's executed after this task's ExecuteAsync method.

Expand Down Expand Up @@ -2405,9 +2402,6 @@ async Task RunInternalAsync ()
ExecutionResult = (ExecutionResult & ~TestExecutingResult.StateMask) | TestExecutingResult.InProgress;

try {
if (Dependency != null)
await Dependency ();

if (InitialTask != null)
await InitialTask;

Expand Down
1 change: 0 additions & 1 deletion tests/xharness/TestProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public class TestProject
public bool IsNUnitProject;
public bool GenerateVariations = true;
public string [] Configurations;
public Func<Task> Dependency;

public IEnumerable<TestProject> ProjectReferences;

Expand Down
Loading

0 comments on commit 74b966e

Please sign in to comment.