diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpCommandLineOptions.cs b/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpCommandLineOptions.cs index cb003f5027..45b2b5924c 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpCommandLineOptions.cs +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpCommandLineOptions.cs @@ -10,6 +10,7 @@ namespace Microsoft.Testing.Extensions.Diagnostics; internal static class CrashDumpCommandLineOptions { public const string CrashDumpOptionName = "crashdump"; + public const string CrashReportOptionName = "crash-report"; public const string CrashDumpFileNameOptionName = "crashdump-filename"; public const string CrashDumpTypeOptionName = "crashdump-type"; } diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpCommandLineProvider.cs b/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpCommandLineProvider.cs index fd028c6edc..166d7dcfec 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpCommandLineProvider.cs +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpCommandLineProvider.cs @@ -11,6 +11,13 @@ namespace Microsoft.Testing.Extensions.Diagnostics; internal sealed class CrashDumpCommandLineProvider : ICommandLineOptionsProvider { private static readonly string[] DumpTypeOptions = ["Mini", "Heap", "Triage", "Full"]; + private static readonly IReadOnlyCollection CachedCommandLineOptions = + [ + new(CrashDumpCommandLineOptions.CrashDumpOptionName, CrashDumpResources.CrashDumpOptionDescription, ArgumentArity.Zero, false), + new(CrashDumpCommandLineOptions.CrashReportOptionName, CrashDumpResources.CrashReportOptionDescription, ArgumentArity.Zero, false), + new(CrashDumpCommandLineOptions.CrashDumpFileNameOptionName, CrashDumpResources.CrashDumpFileNameOptionDescription, ArgumentArity.ExactlyOne, false), + new(CrashDumpCommandLineOptions.CrashDumpTypeOptionName, CrashDumpResources.CrashDumpTypeOptionDescription, ArgumentArity.ExactlyOne, false) + ]; public string Uid => nameof(CrashDumpCommandLineProvider); @@ -22,13 +29,7 @@ internal sealed class CrashDumpCommandLineProvider : ICommandLineOptionsProvider public Task IsEnabledAsync() => Task.FromResult(true); - public IReadOnlyCollection GetCommandLineOptions() - => - [ - new CommandLineOption(CrashDumpCommandLineOptions.CrashDumpOptionName, CrashDumpResources.CrashDumpOptionDescription, ArgumentArity.Zero, false), - new CommandLineOption(CrashDumpCommandLineOptions.CrashDumpFileNameOptionName, CrashDumpResources.CrashDumpFileNameOptionDescription, ArgumentArity.ExactlyOne, false), - new CommandLineOption(CrashDumpCommandLineOptions.CrashDumpTypeOptionName, CrashDumpResources.CrashDumpTypeOptionDescription, ArgumentArity.ExactlyOne, false) - ]; + public IReadOnlyCollection GetCommandLineOptions() => CachedCommandLineOptions; public Task ValidateOptionArgumentsAsync(CommandLineOption commandOption, string[] arguments) { @@ -45,5 +46,8 @@ public Task ValidateOptionArgumentsAsync(CommandLineOption com } public Task ValidateCommandLineOptionsAsync(ICommandLineOptions commandLineOptions) - => ValidationResult.ValidTask; + => commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashReportOptionName) + && RuntimeInformation.IsOSPlatform(OSPlatform.Windows) + ? ValidationResult.InvalidTask(CrashDumpResources.CrashReportNotSupportedOnWindowsErrorMessage) + : ValidationResult.ValidTask; } diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpEnvironmentVariableProvider.cs b/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpEnvironmentVariableProvider.cs index c3b5ed2c8f..62f8ecce84 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpEnvironmentVariableProvider.cs +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpEnvironmentVariableProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Testing.Extensions.Diagnostics.Resources; @@ -18,7 +18,9 @@ internal sealed class CrashDumpEnvironmentVariableProvider : ITestHostEnvironmen private const string MiniDumpNameVariable = "DbgMiniDumpName"; private const string CreateDumpDiagnosticsVariable = "CreateDumpDiagnostics"; private const string CreateDumpVerboseDiagnosticsVariable = "CreateDumpVerboseDiagnostics"; - private const string EnableMiniDumpValue = "1"; + private const string EnableCrashReportVariable = "EnableCrashReport"; + private const string EnableCrashReportOnlyVariable = "EnableCrashReportOnly"; + private const string EnabledValue = "1"; private static readonly string[] Prefixes = ["DOTNET_", "COMPlus_"]; private readonly IConfiguration _configuration; @@ -54,15 +56,34 @@ public CrashDumpEnvironmentVariableProvider( /// public Task IsEnabledAsync() - => Task.FromResult(_commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashDumpOptionName) && _crashDumpGeneratorConfiguration.Enable); + => Task.FromResult( + (_commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashDumpOptionName) || + _commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashReportOptionName)) && + _crashDumpGeneratorConfiguration.Enable); public Task UpdateAsync(IEnvironmentVariables environmentVariables) { + // IsEnabledAsync gates this method, so at least one of --crashdump / --crash-report is set here. + bool crashReportEnabled = _commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashReportOptionName); + foreach (string prefix in Prefixes) { - environmentVariables.SetVariable(new($"{prefix}{EnableMiniDumpVariable}", EnableMiniDumpValue, false, true)); - environmentVariables.SetVariable(new($"{prefix}{CreateDumpDiagnosticsVariable}", EnableMiniDumpValue, false, true)); - environmentVariables.SetVariable(new($"{prefix}{CreateDumpVerboseDiagnosticsVariable}", EnableMiniDumpValue, false, true)); + environmentVariables.SetVariable(new($"{prefix}{EnableMiniDumpVariable}", EnabledValue, false, true)); + environmentVariables.SetVariable(new($"{prefix}{CreateDumpDiagnosticsVariable}", EnabledValue, false, true)); + environmentVariables.SetVariable(new($"{prefix}{CreateDumpVerboseDiagnosticsVariable}", EnabledValue, false, true)); + } + + if (crashReportEnabled) + { + bool crashDumpEnabled = _commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashDumpOptionName); + + // When a dump is also requested, emit a crash report alongside it. + // Otherwise emit only the crash report (no dump file). + string reportVariable = crashDumpEnabled ? EnableCrashReportVariable : EnableCrashReportOnlyVariable; + foreach (string prefix in Prefixes) + { + environmentVariables.SetVariable(new($"{prefix}{reportVariable}", EnabledValue, false, true)); + } } string miniDumpTypeValue = "4"; @@ -133,31 +154,19 @@ public Task ValidateTestHostEnvironmentVariablesAsync(IReadOnl return ValidationResult.InvalidTask(CrashDumpResources.CrashDumpNotSupportedInNonNetCoreErrorMessage); #else StringBuilder errors = new(); - foreach (string prefix in Prefixes) - { - if (!environmentVariables.TryGetVariable($"{prefix}{EnableMiniDumpVariable}", out OwnedEnvironmentVariable? enableMiniDump) - || enableMiniDump.Value != EnableMiniDumpValue) - { - AddError(errors, $"{prefix}{EnableMiniDumpVariable}", EnableMiniDumpValue, enableMiniDump?.Value); - } - } - foreach (string prefix in Prefixes) - { - if (!environmentVariables.TryGetVariable($"{prefix}{CreateDumpDiagnosticsVariable}", out OwnedEnvironmentVariable? enableMiniDump) - || enableMiniDump.Value != EnableMiniDumpValue) - { - AddError(errors, $"{prefix}{CreateDumpDiagnosticsVariable}", EnableMiniDumpValue, enableMiniDump?.Value); - } - } + // IsEnabledAsync gates this method, so at least one of --crashdump / --crash-report is set here. + bool crashReportEnabled = _commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashReportOptionName); - foreach (string prefix in Prefixes) + ValidateBothPrefixes(EnableMiniDumpVariable, EnabledValue); + ValidateBothPrefixes(CreateDumpDiagnosticsVariable, EnabledValue); + ValidateBothPrefixes(CreateDumpVerboseDiagnosticsVariable, EnabledValue); + + if (crashReportEnabled) { - if (!environmentVariables.TryGetVariable($"{prefix}{CreateDumpVerboseDiagnosticsVariable}", out OwnedEnvironmentVariable? enableMiniDump) - || enableMiniDump.Value != EnableMiniDumpValue) - { - AddError(errors, $"{prefix}{CreateDumpVerboseDiagnosticsVariable}", EnableMiniDumpValue, enableMiniDump?.Value); - } + bool crashDumpEnabled = _commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashDumpOptionName); + string reportVariable = crashDumpEnabled ? EnableCrashReportVariable : EnableCrashReportOnlyVariable; + ValidateBothPrefixes(reportVariable, EnabledValue); } foreach (string prefix in Prefixes) @@ -199,6 +208,18 @@ static void AddError(StringBuilder errors, string variableName, string? expected string actualValueString = actualValue ?? ""; errors.AppendLine(string.Format(CultureInfo.InvariantCulture, CrashDumpResources.CrashDumpInvalidEnvironmentVariableValueErrorMessage, variableName, expectedValue, actualValueString)); } + + void ValidateBothPrefixes(string variableName, string expectedValue) + { + foreach (string prefix in Prefixes) + { + if (!environmentVariables.TryGetVariable($"{prefix}{variableName}", out OwnedEnvironmentVariable? variable) + || variable.Value != expectedValue) + { + AddError(errors, $"{prefix}{variableName}", expectedValue, variable?.Value); + } + } + } #endif } } diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpProcessLifetimeHandler.cs b/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpProcessLifetimeHandler.cs index dce2b1b5da..2089877991 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpProcessLifetimeHandler.cs +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpProcessLifetimeHandler.cs @@ -14,6 +14,9 @@ namespace Microsoft.Testing.Extensions.Diagnostics; internal sealed class CrashDumpProcessLifetimeHandler : ITestHostProcessLifetimeHandler, IDataProducer, IOutputDeviceDataProducer { + private const string CrashReportFileExtension = ".crashreport.json"; + private const string CrashReportFileSearchPattern = "*" + CrashReportFileExtension; + private readonly ICommandLineOptions _commandLineOptions; private readonly IMessageBus _messageBus; private readonly IOutputDevice _outputDisplay; @@ -46,8 +49,10 @@ public CrashDumpProcessLifetimeHandler( public Type[] DataTypesProduced => [typeof(FileArtifact)]; public Task IsEnabledAsync() - => Task.FromResult(_commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashDumpOptionName) - && _netCoreCrashDumpGeneratorConfiguration.Enable); + => Task.FromResult( + (_commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashDumpOptionName) || + _commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashReportOptionName)) && + _netCoreCrashDumpGeneratorConfiguration.Enable); public Task BeforeTestHostProcessStartAsync(CancellationToken _) => Task.CompletedTask; @@ -63,22 +68,65 @@ public async Task OnTestHostProcessExitedAsync(ITestHostProcessInformation testH } ApplicationStateGuard.Ensure(_netCoreCrashDumpGeneratorConfiguration.DumpFileNamePattern is not null); - await _outputDisplay.DisplayAsync(this, new ErrorMessageOutputDeviceData(string.Format(CultureInfo.InvariantCulture, CrashDumpResources.CrashDumpProcessCrashedDumpFileCreated, testHostProcessInformation.PID)), cancellationToken).ConfigureAwait(false); + bool generateDump = _commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashDumpOptionName); + bool generateCrashReport = _commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashReportOptionName); // TODO: Crash dump supports more placeholders that we don't handle here. // See "Dump name formatting" in: // https://github.com/dotnet/runtime/blob/82742628310076fff22d7e7ee216a74384352056/docs/design/coreclr/botr/xplat-minidump-generation.md string expectedDumpFile = _netCoreCrashDumpGeneratorConfiguration.DumpFileNamePattern.Replace("%p", testHostProcessInformation.PID.ToString(CultureInfo.InvariantCulture)); - if (File.Exists(expectedDumpFile)) + string expectedCrashReportFile = $"{expectedDumpFile}{CrashReportFileExtension}"; + + // Inspect the disk before emitting the crash banner so the message reflects + // what was actually produced, not what was requested. The runtime may fail + // to emit one (or both) of the artifacts, e.g. when EnableCrashReport is + // unsupported on the current platform/version. + bool dumpFileFound = generateDump && File.Exists(expectedDumpFile); + bool crashReportFileFound = generateCrashReport && File.Exists(expectedCrashReportFile); + + string? processCrashedMessage = (dumpFileFound, crashReportFileFound) switch { - await _messageBus.PublishAsync(this, new FileArtifact(new FileInfo(expectedDumpFile), CrashDumpResources.CrashDumpArtifactDisplayName, CrashDumpResources.CrashDumpArtifactDescription)).ConfigureAwait(false); + (true, true) => string.Format(CultureInfo.InvariantCulture, CrashDumpResources.CrashDumpProcessCrashedDumpAndReportFileCreated, testHostProcessInformation.PID), + (false, true) => string.Format(CultureInfo.InvariantCulture, CrashDumpResources.CrashDumpProcessCrashedReportFileCreated, testHostProcessInformation.PID), + (true, false) => string.Format(CultureInfo.InvariantCulture, CrashDumpResources.CrashDumpProcessCrashedDumpFileCreated, testHostProcessInformation.PID), + (false, false) => string.Format(CultureInfo.InvariantCulture, CrashDumpResources.CrashDumpProcessCrashed, testHostProcessInformation.PID), + }; + await _outputDisplay.DisplayAsync(this, new ErrorMessageOutputDeviceData(processCrashedMessage), cancellationToken).ConfigureAwait(false); + + if (generateDump) + { + if (dumpFileFound) + { + await _messageBus.PublishAsync(this, new FileArtifact(new FileInfo(expectedDumpFile), CrashDumpResources.CrashDumpArtifactDisplayName, CrashDumpResources.CrashDumpArtifactDescription)).ConfigureAwait(false); + } + else + { + await _outputDisplay.DisplayAsync(this, new ErrorMessageOutputDeviceData(string.Format(CultureInfo.InvariantCulture, CrashDumpResources.CannotFindExpectedCrashDumpFile, expectedDumpFile)), cancellationToken).ConfigureAwait(false); + + // Filter by exact extension to defend against Windows' legacy 8.3 short-name + // matching where a pattern like '*.dmp' can also match files whose extension + // merely starts with '.dmp' (for example 'foo.dmp.crashreport.json'). + foreach (string dumpFile in Directory.EnumerateFiles(Path.GetDirectoryName(expectedDumpFile)!, "*.dmp") + .Where(static f => Path.GetExtension(f).Equals(".dmp", StringComparison.OrdinalIgnoreCase))) + { + await _messageBus.PublishAsync(this, new FileArtifact(new FileInfo(dumpFile), CrashDumpResources.CrashDumpDisplayName, CrashDumpResources.CrashDumpArtifactDescription)).ConfigureAwait(false); + } + } } - else + + if (generateCrashReport) { - await _outputDisplay.DisplayAsync(this, new ErrorMessageOutputDeviceData(string.Format(CultureInfo.InvariantCulture, CrashDumpResources.CannotFindExpectedCrashDumpFile, expectedDumpFile)), cancellationToken).ConfigureAwait(false); - foreach (string dumpFile in Directory.GetFiles(Path.GetDirectoryName(expectedDumpFile)!, "*.dmp")) + if (crashReportFileFound) + { + await _messageBus.PublishAsync(this, new FileArtifact(new FileInfo(expectedCrashReportFile), CrashDumpResources.CrashReportArtifactDisplayName, CrashDumpResources.CrashReportArtifactDescription)).ConfigureAwait(false); + } + else { - await _messageBus.PublishAsync(this, new FileArtifact(new FileInfo(dumpFile), CrashDumpResources.CrashDumpDisplayName, CrashDumpResources.CrashDumpArtifactDescription)).ConfigureAwait(false); + await _outputDisplay.DisplayAsync(this, new ErrorMessageOutputDeviceData(string.Format(CultureInfo.InvariantCulture, CrashDumpResources.CannotFindExpectedCrashReportFile, expectedCrashReportFile, CrashReportFileSearchPattern)), cancellationToken).ConfigureAwait(false); + foreach (string crashReportFile in Directory.GetFiles(Path.GetDirectoryName(expectedCrashReportFile)!, CrashReportFileSearchPattern)) + { + await _messageBus.PublishAsync(this, new FileArtifact(new FileInfo(crashReportFile), CrashDumpResources.CrashReportArtifactDisplayName, CrashDumpResources.CrashReportArtifactDescription)).ConfigureAwait(false); + } } } } diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/PACKAGE.md b/src/Platform/Microsoft.Testing.Extensions.CrashDump/PACKAGE.md index 6edac3ba07..92c8c405cb 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/PACKAGE.md +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/PACKAGE.md @@ -1,6 +1,6 @@ # Microsoft.Testing.Extensions.CrashDump -Microsoft.Testing.Extensions.CrashDump is an extension for [Microsoft.Testing.Platform](https://www.nuget.org/packages/Microsoft.Testing.Platform) that captures a crash dump of the test host process when an unhandled exception or crash occurs. +Microsoft.Testing.Extensions.CrashDump is an extension for [Microsoft.Testing.Platform](https://www.nuget.org/packages/Microsoft.Testing.Platform) that captures a crash dump or crash report for the test host process when an unhandled exception or crash occurs. Microsoft.Testing.Platform is open source. You can find `Microsoft.Testing.Extensions.CrashDump` code in the [microsoft/testfx](https://github.com/microsoft/testfx) GitHub repository. @@ -15,11 +15,13 @@ dotnet add package Microsoft.Testing.Extensions.CrashDump This package extends Microsoft.Testing.Platform with: - **Crash dump collection**: automatically captures a memory dump when the test process crashes +- **Crash report collection**: optionally emits a lightweight JSON crash report to help diagnose crashes without uploading a full dump (Linux/macOS only — see [dotnet/runtime#80191](https://github.com/dotnet/runtime/issues/80191)) - **Post-mortem debugging**: collected dumps can be analyzed with tools like Visual Studio, WinDbg, or `dotnet-dump` -- **Cross-platform**: supported on Windows, Linux, and macOS. Note that dumps collected on macOS can only be analyzed on macOS +- **Cross-platform**: crash dumps are supported on Windows, Linux, and macOS (dumps collected on macOS can only be analyzed on macOS). Crash reports are currently only supported on Linux and macOS. - **Runtime behavior**: supported for .NET 6+; on .NET Framework this extension is ignored Enable crash dump collection via the `--crashdump` command line option. +Add `--crash-report` (Linux/macOS only) to generate a JSON crash report; combine `--crashdump --crash-report` to produce both a dump and a report. ## Related packages diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/CrashDumpResources.resx b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/CrashDumpResources.resx index 86e83bf522..f67b12500a 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/CrashDumpResources.resx +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/CrashDumpResources.resx @@ -120,6 +120,9 @@ Expected crash dump file '{0}' could not be found, all files matching the '*.dmp' pattern will be copied to the result folder + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + The testhost process crash dump file @@ -144,9 +147,18 @@ [net6.0+ only] Generate a dump file if the test process crashes + + Test host process with PID '{0}' crashed + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file was generated + + Test host process with PID '{0}' crashed, a crash report was generated + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -158,6 +170,18 @@ For more information visit https://learn.microsoft.com/dotnet/core/diagnostics/c '--crashdump-type' expects a single dump type as argument (e.g. '--crashdump-type Heap') + + The testhost process crash report file + + + Crash report file + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + Requests of type '{0}' is not supported diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.cs.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.cs.xlf index 4874a45bfb..33f3571a46 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.cs.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.cs.xlf @@ -7,6 +7,11 @@ Nebyl nalezen očekávaný soubor výpisu stavu systému {0}. Všechny soubory odpovídající vzoru *.dmp budou zkopírovány do složky výsledků. + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file Soubor výpisu stavu systému procesu testhost @@ -47,11 +52,26 @@ [Pouze net6.0+ ] Vygenerovat soubor výpisu paměti v případě chybového ukončení procesu testu + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated Hostitelský proces testu s identifikátorem PID {0} byl chybově ukončen. Byl vygenerován soubor výpisu paměti. + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ Další informace najdete na https://learn.microsoft.com/dotnet/core/diagnostics --hangdump-type očekává jako argument jeden typ výpisu paměti (například --hangdump-type Heap). + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported Žádosti typu {0} nejsou podporovány. diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.de.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.de.xlf index 12d9a235f0..7e2ff06485 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.de.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.de.xlf @@ -7,6 +7,11 @@ Die erwartete Absturzabbilddatei "{0}" wurde nicht gefunden. Alle Dateien, die dem Muster "*.dmp" entsprechen, werden in den Ergebnisordner kopiert + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file Die Absturzabbilddatei für den Testhostprozess @@ -47,11 +52,26 @@ [nur net6.0+] Speicherabbilddatei generieren, wenn der Testprozess abstürzt + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated Der Testhostprozess mit PID "{0}" ist abgestürzt. Es wurde eine Abbilddatei generiert + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ Weitere Informationen finden Sie unter https://learn.microsoft.com/dotnet/core/d "--crashdump-type" erwartet einen einzelnen Speicherabbildtyp als Argument (z. B. "--crashdump-type Heap") + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported Anforderungen vom Typ "{0}" werden nicht unterstützt diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.es.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.es.xlf index 2d53d62722..56271cdb54 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.es.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.es.xlf @@ -7,6 +7,11 @@ No se encontró el '{0}' de archivo de volcado esperado. Todos los archivos que coincidan con el patrón "*.dmp" se copiarán en la carpeta de resultados. + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file Archivo de volcado de memoria del proceso del host de pruebas @@ -47,11 +52,26 @@ [solo net6.0+ ] Generar un archivo de volcado si el proceso de prueba se bloquea + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated Se bloqueó el proceso de host de prueba con PID '{0}' y se generó un archivo de volcado + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ Para obtener más información, visite https://learn.microsoft.com/dotnet/core/d '--crashdump-type' espera un único tipo de volcado como argumento (por ejemplo, '--crashdump-type Heap') + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported No se admiten solicitudes de tipo '{0}' diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.fr.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.fr.xlf index af3adfcfbc..0b0a7d52c3 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.fr.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.fr.xlf @@ -7,6 +7,11 @@ Le fichier de vidage sur incident attendu « {0} » n'a pas été trouvé, tous les fichiers correspondant au modèle « *.dmp » seront copiés dans le dossier de résultats. + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file Le fichier de vidage sur incident du processus testhost @@ -47,11 +52,26 @@ [net6.0+ uniquement] Générer un fichier de vidage si le processus de test se bloque + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated Le processus hôte de test avec le PID «{0}» s’est arrêté, un fichier de vidage a été généré + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ Pour plus d’informations, visitez https://learn.microsoft.com/dotnet/core/diag '--crashdump-type' attend un seul type de dump comme argument (par exemple '--crashdump-type Heap') + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported Les demandes de type «{0}» ne sont pas prises en charge diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.it.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.it.xlf index e9af7b3ed6..862d8cda02 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.it.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.it.xlf @@ -7,6 +7,11 @@ Il file di dump di arresto anomalo '{0}' previsto non è stato trovato. Tutti i file corrispondenti al criterio '*.dmp' verranno copiati nella cartella dei risultati. + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file File di dump di arresto anomalo del processo testhost @@ -47,11 +52,26 @@ [solo net6.0+ ] Generazione di un file di dump in caso di arresto anomalo del processo di test + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated Il processo host di test con PID '{0}' si è arrestato in modo anomalo. È stato generato un file di dump + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ Per altre informazioni, visitare https://learn.microsoft.com/dotnet/core/diagnos '--crashdump-type' prevede un singolo tipo di dump come argomento (ad esempio '--crashdump-type Heap') + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported Le richieste di tipo '{0}' non sono supportate diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ja.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ja.xlf index 4e9828351c..ed380378a9 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ja.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ja.xlf @@ -7,6 +7,11 @@ 予期されたクラッシュ ダンプ ファイル '{0}' が見つかりませんでした。'*.dmp' パターンに一致するすべてのファイルが結果フォルダーにコピーされます + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file testhost プロセスのクラッシュ ダンプ ファイル @@ -47,11 +52,26 @@ [net6.0+ のみ] テスト プロセスがクラッシュした場合にダンプ ファイルを生成する + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated PID '{0}' のテスト ホスト プロセスがクラッシュしました。ダンプ ファイルが生成されました + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ For more information visit https://learn.microsoft.com/dotnet/core/diagnostics/c '--crashdump-type' には、引数として 1 つのダンプの型が必要です (例: '--crashdump-type Heap') + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported 型 '{0}' の要求はサポートされていません diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ko.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ko.xlf index 4f3ee10358..cf122c7d3e 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ko.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ko.xlf @@ -7,6 +7,11 @@ 필요한 크래시 덤프 파일 '{0}'을(를) 찾을 수 없습니다. '*.dmp' 패턴과 일치하는 모든 파일이 결과 폴더에 복사됩니다. + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file testhost 프로세스 크래시 덤프 파일 @@ -47,11 +52,26 @@ [net6.0 이상만] 테스트 프로세스가 충돌하는 경우 덤프 파일 생성 + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated PID가 '{0}'인 테스트 호스트 프로세스가 충돌했습니다. 덤프 파일이 생성되었습니다. + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ For more information visit https://learn.microsoft.com/dotnet/core/diagnostics/c '--crashdump-type'에는 단일 덤프 유형이 인수로 필요합니다(예: '--crashdump-type Heap'). + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported '{0}' 유형의 요청은 지원되지 않습니다. diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.pl.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.pl.xlf index ff360e4442..39ce261eed 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.pl.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.pl.xlf @@ -7,6 +7,11 @@ Nie można odnaleźć oczekiwanego pliku zrzutu awaryjnego „{0}”. Wszystkie pliki zgodne ze wzorcem „*.dmp” zostaną skopiowane do folderu wyników + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file Plik zrzutu awaryjnego procesu testhost @@ -47,11 +52,26 @@ [tylko net6.0+ ] Wygeneruj plik zrzutu w przypadku awarii procesu testowego + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated Proces hosta testowego o identyfikatorze PID „{0}{0}” uległ awarii, wygenerowano plik zrzutu + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ Aby uzyskać więcej informacji, odwiedź stronę https://learn.microsoft.com/do Element „--crashdump-type” oczekuje pojedynczego typu zrzutu jako argumentu (np. „--crashdump-type Heap”) + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported Żądania typu „{0}” nie są obsługiwane diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.pt-BR.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.pt-BR.xlf index 30bf9ddd72..fd5fd6560e 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.pt-BR.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.pt-BR.xlf @@ -7,6 +7,11 @@ O arquivo de despejo de memória ''{0}'' não pôde ser encontrado. Todos os arquivos correspondentes ao padrão ''*.dmp'' serão copiados para a pasta de resultados + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file O arquivo de despejo de memória do processo testhost @@ -47,11 +52,26 @@ [somente net6.0+] Gerar um arquivo de despejo se o processo de teste falhar + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated O processo de host de teste com PID ''{0}'' falhou e um arquivo de despejo foi gerado + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ Para obter mais informações, visite https://learn.microsoft.com/dotnet/core/di ''--crashdump-type'' espera um único tipo de despejo como argumento (por exemplo, ''--crashdump-type Heap'') + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported Não há suporte para solicitações de tipo ''{0}'' diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ru.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ru.xlf index f88ad320fe..a6e15ee7e3 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ru.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.ru.xlf @@ -7,6 +7,11 @@ Не удалось найти ожидаемый файл аварийного дампа "{0}". Все файлы, соответствующие шаблону "*.dmp", будут скопированы в папку результатов. + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file Файл аварийного дампа тестового хост-процесса @@ -47,11 +52,26 @@ [только net6.0 и выше] Создавать файл дампа в случае сбоя тестового процесса + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated Произошло аварийное завершение тестового хост-процесса с идентификатором процесса "{0}". Создан файл дампа + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ For more information visit https://learn.microsoft.com/dotnet/core/diagnostics/c "--hangdump-type" ожидает в качестве аргумента один тип дампа (например, "--crashdump-type Heap") + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported Запросы типа "{0}" не поддерживаются diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.tr.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.tr.xlf index 1a67584b25..2d6daa461a 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.tr.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.tr.xlf @@ -7,6 +7,11 @@ Beklenen kilitlenme dökümü dosyası '{0}' bulunamadı, '*.dmp' düzeniyle eşleşen tüm dosyalar sonuç klasörüne kopyalanacak + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file Test ana bilgisayarı işlemi kilitlenme bilgi dökümü dosyası @@ -47,11 +52,26 @@ [yalnızca net6.0+] Test işlemi çökerse bir döküm dosyası oluşturun + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated PID'li test ana işlemi ‘{0}' kilitlendi, bir döküm dosyası oluşturuldu + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ Daha fazla bilgi için https://learn.microsoft.com/dotnet/core/diagnostics/colle '--crashdump-type' argüman olarak tek bir döküm tipini bekler (örneğin, '--crashdump-type Heap') + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported '{0}' türündeki istek desteklenmiyor diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.zh-Hans.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.zh-Hans.xlf index 159e244e68..cd81d221c6 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.zh-Hans.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.zh-Hans.xlf @@ -7,6 +7,11 @@ 找不到预期的故障转储文件“{0}”,与“*.dmp”模式匹配的所有文件都将复制到结果文件夹 + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file testhost 进程故障转储文件 @@ -47,11 +52,26 @@ [仅限 net6.0+]如果测试进程崩溃,则生成转储文件 + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated PID 为“{0}”的测试主机进程崩溃,生成了转储文件 + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ For more information visit https://learn.microsoft.com/dotnet/core/diagnostics/c “--crashdump-type”需要将单一转储类型作为参数(例如“--crashdump-type Heap”) + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported 不支持类型为“{0}”的请求 diff --git a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.zh-Hant.xlf b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.zh-Hant.xlf index 4edcf4cbc3..e44ba849a8 100644 --- a/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.zh-Hant.xlf +++ b/src/Platform/Microsoft.Testing.Extensions.CrashDump/Resources/xlf/CrashDumpResources.zh-Hant.xlf @@ -7,6 +7,11 @@ 找不到預期的損毀傾印檔案 '{0}',符合 '*.dmp' 模式的所有檔案都將複製到結果資料夾 + + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + Expected crash report file '{0}' could not be found, all files matching the '{1}' pattern will be copied to the result folder + + The testhost process crash dump file testhost 處理常式損毀傾印檔案 @@ -47,11 +52,26 @@ [net6.0+ only] 如果測試流程損毀,則產生傾印檔案 + + Test host process with PID '{0}' crashed + Test host process with PID '{0}' crashed + + + + Test host process with PID '{0}' crashed, a dump file and crash report were generated + Test host process with PID '{0}' crashed, a dump file and crash report were generated + + Test host process with PID '{0}' crashed, a dump file was generated PID '{0}' 損毀的測試主機處理常式,已產生傾印檔案 + + Test host process with PID '{0}' crashed, a crash report was generated + Test host process with PID '{0}' crashed, a crash report was generated + + Specify the type of the dump. Valid values are 'Mini', 'Heap', 'Triage' or 'Full'. Default type is 'Full'. @@ -71,6 +91,26 @@ For more information visit https://learn.microsoft.com/dotnet/core/diagnostics/c '--crashdump-type' 需要單一傾印類型做為引數 (例如 '--crashdump-type Heap') + + The testhost process crash report file + The testhost process crash report file + + + + Crash report file + Crash report file + + + + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + '--crash-report' is not supported on Windows because the .NET runtime ignores the underlying 'DOTNET_EnableCrashReport' and 'DOTNET_EnableCrashReportOnly' environment variables on this platform. See https://github.com/dotnet/runtime/issues/80191. Use '--crashdump' to generate a crash dump file instead. + + + + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). + + Requests of type '{0}' is not supported 不支援類型 '{0}' 的要求 diff --git a/src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineHandler.cs b/src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineHandler.cs index 916ff42448..a37bf6ef95 100644 --- a/src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineHandler.cs +++ b/src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineHandler.cs @@ -110,7 +110,10 @@ async Task DisplayOptionsAsync(IOutputDevice outputDevice, IEnumerable x.Name)) + // Use StringComparer.Ordinal so the option ordering is deterministic across TFMs + // (the culture-aware default sorts '-' differently between .NET Framework and .NET (Core)). + // Note: this affects the visible order of options in `--help` / `--info` output. + foreach (CommandLineOption option in options.OrderBy(x => x.Name, StringComparer.Ordinal)) { string optionName = $"{optionNameIndent}--{option.Name}"; await outputDevice.DisplayAsync(this, new TextOutputDeviceData(optionName), cancellationToken).ConfigureAwait(false); @@ -249,7 +252,8 @@ async Task PrintOptionsAsync(IEnumerable opti [.. optionProviders .SelectMany(provider => provider.GetCommandLineOptions()) .Where(option => !option.IsHidden && option.IsBuiltIn == builtInOnly) - .OrderBy(option => option.Name)]; + // See DisplayOptionsAsync for the rationale behind using StringComparer.Ordinal. + .OrderBy(option => option.Name, StringComparer.Ordinal)]; if (options.Length == 0) { diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs index cf7e844be3..180ab0a529 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/CrashDumpTests.cs @@ -44,6 +44,56 @@ public async Task CrashDump_Formats_CreateDump(string format) File.Delete(dumpFile); } + [TestMethod] + [OSCondition(ConditionMode.Exclude, OperatingSystems.Windows, IgnoreMessage = "Crash report generation is not supported on Windows (dotnet/runtime#80191)")] + public async Task CrashDump_WithCrashReport_CreateDumpAndCrashReport() + { + string resultDirectory = Path.Combine(AssetFixture.TargetAssetPath, Guid.NewGuid().ToString("N")); + var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, "CrashDump", TargetFrameworks.NetCurrent); + TestHostResult testHostResult = await testHost.ExecuteAsync($"--crashdump --crash-report --results-directory {resultDirectory}", cancellationToken: TestContext.CancellationToken); + testHostResult.AssertExitCodeIs(ExitCode.TestHostProcessExitedNonGracefully); + + Assert.ContainsSingle(Directory.GetFiles(resultDirectory, "CrashDump_*.dmp", SearchOption.AllDirectories), $"Dump file not found\n{testHostResult}"); + Assert.ContainsSingle(Directory.GetFiles(resultDirectory, "CrashDump_*.dmp.crashreport.json", SearchOption.AllDirectories), $"Crash report file not found\n{testHostResult}"); + } + + [TestMethod] + [OSCondition(ConditionMode.Exclude, OperatingSystems.Windows, IgnoreMessage = "Crash report generation is not supported on Windows (dotnet/runtime#80191)")] + public async Task CrashReport_DefaultSetting_CreatesOnlyCrashReport() + { + string resultDirectory = Path.Combine(AssetFixture.TargetAssetPath, Guid.NewGuid().ToString("N")); + var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, "CrashDump", TargetFrameworks.NetCurrent); + TestHostResult testHostResult = await testHost.ExecuteAsync($"--crash-report --results-directory {resultDirectory}", cancellationToken: TestContext.CancellationToken); + testHostResult.AssertExitCodeIs(ExitCode.TestHostProcessExitedNonGracefully); + + Assert.IsEmpty(Directory.GetFiles(resultDirectory, "CrashDump_*.dmp", SearchOption.AllDirectories), $"Unexpected dump file found\n{testHostResult}"); + Assert.ContainsSingle(Directory.GetFiles(resultDirectory, "CrashDump_*.dmp.crashreport.json", SearchOption.AllDirectories), $"Crash report file not found\n{testHostResult}"); + } + + [TestMethod] + [OSCondition(ConditionMode.Exclude, OperatingSystems.Windows, IgnoreMessage = "Crash report generation is not supported on Windows (dotnet/runtime#80191)")] + public async Task CrashReport_WithCustomDumpFilename_CreatesOnlyCrashReport() + { + string resultDirectory = Path.Combine(AssetFixture.TargetAssetPath, Guid.NewGuid().ToString("N")); + var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, "CrashDump", TargetFrameworks.NetCurrent); + TestHostResult testHostResult = await testHost.ExecuteAsync($"--crash-report --crashdump-filename customdumpname.dmp --results-directory {resultDirectory}", cancellationToken: TestContext.CancellationToken); + testHostResult.AssertExitCodeIs(ExitCode.TestHostProcessExitedNonGracefully); + + Assert.IsEmpty(Directory.GetFiles(resultDirectory, "customdumpname.dmp", SearchOption.AllDirectories), $"Unexpected dump file found\n{testHostResult}"); + Assert.ContainsSingle(Directory.GetFiles(resultDirectory, "customdumpname.dmp.crashreport.json", SearchOption.AllDirectories), $"Crash report file not found\n{testHostResult}"); + } + + [TestMethod] + [OSCondition(ConditionMode.Include, OperatingSystems.Windows, IgnoreMessage = "Validates Windows-specific error for --crash-report")] + public async Task CrashReport_OnWindows_FailsWithValidationError() + { + string resultDirectory = Path.Combine(AssetFixture.TargetAssetPath, Guid.NewGuid().ToString("N")); + var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, "CrashDump", TargetFrameworks.NetCurrent); + TestHostResult testHostResult = await testHost.ExecuteAsync($"--crash-report --results-directory {resultDirectory}", cancellationToken: TestContext.CancellationToken); + testHostResult.AssertExitCodeIs(ExitCode.InvalidCommandLine); + testHostResult.AssertOutputContains("'--crash-report' is not supported on Windows"); + } + [TestMethod] public async Task CrashDump_InvalidFormat_ShouldFail() { diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs index 107cdc8392..d989315655 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoAllExtensionsTests.cs @@ -71,6 +71,8 @@ Retry failed tests the given number of times A global test execution timeout. Takes one argument as string in the format [h|m|s] where 'value' is float. Extension options: + --crash-report + [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). --crashdump [net6.0+ only] Generate a dump file if the test process crashes --crashdump-filename @@ -272,6 +274,10 @@ Takes one argument as string in the format [h|m|s] where 'value' is float Version: * Description: [net6.0+ only] Produce crash dump files when the test execution process crashes unexpectedly Options: + --crash-report + Arity: 0 + Hidden: False + Description: [Linux/macOS only] Generate a JSON crash report when the test process crashes. Combine with '--crashdump' to also generate a dump file. Requires .NET 7+ when used alone; .NET 6+ when combined with '--crashdump'. This runtime requirement is not enforced by the tool: on unsupported runtimes no crash report will be emitted. Not supported on Windows due to a .NET runtime limitation (dotnet/runtime#80191). --crashdump Arity: 0 Hidden: False diff --git a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/CrashDumpTests.cs b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/CrashDumpTests.cs index 4f2b1640f2..e2128bb003 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/CrashDumpTests.cs +++ b/test/UnitTests/Microsoft.Testing.Extensions.UnitTests/CrashDumpTests.cs @@ -38,7 +38,7 @@ public async Task IsInvValid_If_CrashDumpType_Has_IncorrectValue() } [TestMethod] - public async Task CrashDump_CommandLineOptions_Are_AlwaysValid() + public async Task CrashDump_CommandLineOptions_Are_Valid_ByDefault() { var provider = new CrashDumpCommandLineProvider(); @@ -46,4 +46,66 @@ public async Task CrashDump_CommandLineOptions_Are_AlwaysValid() Assert.IsTrue(validateOptionsResult.IsValid); Assert.IsTrue(string.IsNullOrEmpty(validateOptionsResult.ErrorMessage)); } + + [TestMethod] + [OSCondition(ConditionMode.Exclude, OperatingSystems.Windows, IgnoreMessage = "Crash report is not supported on Windows (dotnet/runtime#80191)")] + public async Task CrashReport_Without_CrashDump_Is_Valid() + { + var provider = new CrashDumpCommandLineProvider(); + var options = new Dictionary + { + { CrashDumpCommandLineOptions.CrashReportOptionName, [] }, + }; + + ValidationResult validateOptionsResult = await provider.ValidateCommandLineOptionsAsync(new TestCommandLineOptions(options)).ConfigureAwait(false); + Assert.IsTrue(validateOptionsResult.IsValid); + Assert.IsTrue(string.IsNullOrEmpty(validateOptionsResult.ErrorMessage)); + } + + [TestMethod] + [OSCondition(ConditionMode.Exclude, OperatingSystems.Windows, IgnoreMessage = "Crash report is not supported on Windows (dotnet/runtime#80191)")] + public async Task CrashReport_Alongside_CrashDump_Is_Valid() + { + var provider = new CrashDumpCommandLineProvider(); + var options = new Dictionary + { + { CrashDumpCommandLineOptions.CrashDumpOptionName, [] }, + { CrashDumpCommandLineOptions.CrashReportOptionName, [] }, + }; + + ValidationResult validateOptionsResult = await provider.ValidateCommandLineOptionsAsync(new TestCommandLineOptions(options)).ConfigureAwait(false); + Assert.IsTrue(validateOptionsResult.IsValid); + Assert.IsTrue(string.IsNullOrEmpty(validateOptionsResult.ErrorMessage)); + } + + [TestMethod] + [OSCondition(ConditionMode.Include, OperatingSystems.Windows, IgnoreMessage = "Validates Windows-specific rejection of --crash-report")] + public async Task CrashReport_OnWindows_IsInvalid() + { + var provider = new CrashDumpCommandLineProvider(); + var options = new Dictionary + { + { CrashDumpCommandLineOptions.CrashReportOptionName, [] }, + }; + + ValidationResult validateOptionsResult = await provider.ValidateCommandLineOptionsAsync(new TestCommandLineOptions(options)).ConfigureAwait(false); + Assert.IsFalse(validateOptionsResult.IsValid); + Assert.Contains("'--crash-report' is not supported on Windows", validateOptionsResult.ErrorMessage); + } + + [TestMethod] + [OSCondition(ConditionMode.Include, OperatingSystems.Windows, IgnoreMessage = "Validates Windows-specific rejection of --crash-report")] + public async Task CrashReport_WithCrashDump_OnWindows_IsInvalid() + { + var provider = new CrashDumpCommandLineProvider(); + var options = new Dictionary + { + { CrashDumpCommandLineOptions.CrashDumpOptionName, [] }, + { CrashDumpCommandLineOptions.CrashReportOptionName, [] }, + }; + + ValidationResult validateOptionsResult = await provider.ValidateCommandLineOptionsAsync(new TestCommandLineOptions(options)).ConfigureAwait(false); + Assert.IsFalse(validateOptionsResult.IsValid); + Assert.Contains("'--crash-report' is not supported on Windows", validateOptionsResult.ErrorMessage); + } }