Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Version.Details.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This file should be imported by eng/Versions.props
<MicrosofttvOSSdknet90_185PackageVersion>18.5.9227</MicrosofttvOSSdknet90_185PackageVersion>
<MicrosofttvOSSdknet90_265PackageVersion>26.5.9004</MicrosofttvOSSdknet90_265PackageVersion>
<!-- dotnet-xharness dependencies -->
<MicrosoftDotNetXHarnessiOSSharedPackageVersion>11.0.0-prerelease.26424.4</MicrosoftDotNetXHarnessiOSSharedPackageVersion>
<MicrosoftDotNetXHarnessiOSSharedPackageVersion>11.0.0-prerelease.26427.1</MicrosoftDotNetXHarnessiOSSharedPackageVersion>
<!-- xamarin-xamarin-macios dependencies -->
<MicrosoftiOSSdknet90_180PackageVersion>18.0.9617</MicrosoftiOSSdknet90_180PackageVersion>
<MicrosoftMacCatalystSdknet90_180PackageVersion>18.0.9617</MicrosoftMacCatalystSdknet90_180PackageVersion>
Expand Down
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@
<Uri>https://github.com/dotnet/dotnet</Uri>
<Sha>6e38c59c51ac7a6995f6252de38caaff27af165d</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.iOS.Shared" Version="11.0.0-prerelease.26424.4">
<Dependency Name="Microsoft.DotNet.XHarness.iOS.Shared" Version="11.0.0-prerelease.26427.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>8175b669ea7188fce75ed33abedae717cb20af4b</Sha>
<Sha>31fee41307f51d5108eba7a4c60e469ce06d620f</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.26381.105">
<Uri>https://github.com/dotnet/dotnet</Uri>
Expand Down
5 changes: 2 additions & 3 deletions tests/xharness/AppRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public async Task<int> RunAsync ()
listener.StartAsync ();

// object that will take care of capturing and parsing the results
ICrashSnapshotReporter crashReporter = snapshotReporterFactory.Create (MainLog, Logs, isDevice: !isSimulator, deviceName);
ICrashSnapshotReporter crashReporter = snapshotReporterFactory.Create (MainLog, Logs, isDevice: !isSimulator, deviceName, AppInformation);

var testReporterTimeout = TimeSpan.FromMinutes (harness.Timeout * timeoutMultiplier);
var testReporter = testReporterFactory.Create (MainLog,
Expand All @@ -288,8 +288,7 @@ public async Task<int> RunAsync ()
harness.XmlJargon,
deviceName,
testReporterTimeout,
buildTask?.Logs?.Directory,
(level, message) => harness.Log (level, message));
buildTask?.Logs?.Directory);

listener.ConnectedTask
.TimeoutAfter (TimeSpan.FromMinutes (harness.LaunchTimeout))
Expand Down
4 changes: 2 additions & 2 deletions tests/xharness/CrashSnapshotReporterFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public CrashSnapshotReporterFactory (IMlaunchProcessManager processManager)
this.processManager = processManager ?? throw new ArgumentNullException (nameof (processManager));
}

public ICrashSnapshotReporter Create (ILog log, ILogs logs, bool isDevice, string? deviceName) =>
new CrashSnapshotReporter (processManager, log, logs, isDevice, deviceName);
public ICrashSnapshotReporter Create (ILog log, ILogs logs, bool isDevice, string? deviceName, AppBundleInformation appInformation) =>
new CrashSnapshotReporter (processManager, log, logs, isDevice, deviceName, appInformation);
}
}
6 changes: 4 additions & 2 deletions tests/xharness/Jenkins/TestTasks/MacExecuteTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public override async Task RunTestAsync ()
var assemblyName = project.GetAssemblyName ();
Path = System.IO.Path.Combine (System.IO.Path.GetDirectoryName (ProjectFile)!, outputPath!, assemblyName + ".app", "Contents", "MacOS", assemblyName);
}
var appBundlePath = System.IO.Path.GetFullPath (System.IO.Path.Combine (System.IO.Path.GetDirectoryName (Path)!, "..", ".."));
var appInformation = new AppBundleInformation (name!, "N/A", appBundlePath, appBundlePath, true, null, System.IO.Path.GetFileName (Path));

using (var resource = await NotifyAndAcquireDesktopResourceAsync ()) {
using (var proc = new Process ()) {
Expand Down Expand Up @@ -92,7 +94,7 @@ public override async Task RunTestAsync ()
if (!Jenkins.Harness.DryRun) {
ExecutionResult = TestExecutingResult.Running;

snapshot = CrashReportSnapshotFactory.Create (log, Logs, isDevice: false, deviceName: null);
snapshot = CrashReportSnapshotFactory.Create (log, Logs, isDevice: false, deviceName: null, appInformation);
await snapshot.StartCaptureAsync ();

ProcessExecutionResult? result = null;
Expand Down Expand Up @@ -120,7 +122,7 @@ public override async Task RunTestAsync ()
if (IsUnitTest) {
var reporterFactory = new TestReporterFactory (ProcessManager);
var listener = new Microsoft.DotNet.XHarness.iOS.Shared.Listeners.SimpleFileListener (xmlLog!.FullPath, log, xmlLog, useXmlOutput);
var reporter = reporterFactory.Create (Harness.HarnessLog!, log, Logs, snapshot!, listener, Harness.ResultParser, new AppBundleInformation ("N/A", "N/A", "N/A", "N/A", true, null), RunMode.MacOS, Harness.XmlJargon, "no device here", TimeSpan.Zero);
var reporter = reporterFactory.Create (Harness.HarnessLog!, log, Logs, snapshot!, listener, Harness.ResultParser, appInformation, RunMode.MacOS, Harness.XmlJargon, "no device here", TimeSpan.Zero);
var rv = await reporter.ParseResult ();

if (ExecutionResult == TestExecutingResult.Succeeded) {
Expand Down
6 changes: 3 additions & 3 deletions tests/xharness/TestReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class TestReporter : ITestReporter {

public bool ResultsUseXml => xmlJargon != XmlResultJargon.Missing;

bool TestExecutionStarted => listener.ConnectedTask.IsCompletedSuccessfully && listener.ConnectedTask.Result;
public bool TestProtocolConnected => listener.ConnectedTask.IsCompletedSuccessfully && listener.ConnectedTask.Result;

public TestReporter (
IMlaunchProcessManager processManager,
Expand Down Expand Up @@ -228,7 +228,7 @@ public void LaunchCallback (Task<bool> launchResult)
cancellationTokenSource.Cancel ();
timedout = true;

if (TestExecutionStarted) {
if (TestProtocolConnected) {
mainLog.WriteLine ($"Test execution timed out after {timeoutWatch.Elapsed.TotalMinutes:0.##} minutes");
return;
}
Expand Down Expand Up @@ -464,7 +464,7 @@ async Task GenerateXmlFailures (string failure, bool crashed, string? crashReaso
await crashReporter.EndCaptureAsync (TimeSpan.FromSeconds (crashLogWaitTime));

if (timedout) {
if (TestExecutionStarted) {
if (TestProtocolConnected) {
result.ExecutingResult = TestExecutingResult.TimedOut;
} else {
result.ExecutingResult = TestExecutingResult.LaunchTimedOut;
Expand Down
6 changes: 1 addition & 5 deletions tests/xharness/TestReporterFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
using Microsoft.DotNet.XHarness.iOS.Shared.Logging;
using Microsoft.DotNet.XHarness.iOS.Shared.XmlResults;

using ExceptionLogger = System.Action<int, string>;

namespace Xharness {
public class TestReporterFactory : ITestReporterFactory {
readonly IMlaunchProcessManager processManager;
Expand All @@ -35,7 +33,6 @@ public ITestReporter Create (
string? device,
TimeSpan timeout,
string? additionalLogsDirectory = null,
ExceptionLogger? exceptionLogger = null,
bool generateHtml = false)
{
return new TestReporter (
Expand All @@ -52,8 +49,7 @@ public ITestReporter Create (
device,
timeout,
additionalLogsDirectory,
exceptionLogger,
generateHtml);
generateHtml: generateHtml);
}
}
}
Loading