Summary
Microsoft.Testing.Extensions.CrashDump accepts --crashdump-filename and --crashdump-type without requiring --crashdump or --crash-report. Unlike HangDump, those sub-options are not rejected when the main feature is off, so they are silently ignored.
Evidence
Q:\src\testfx\src\Platform\Microsoft.Testing.Extensions.CrashDump\CrashDumpCommandLineProvider.cs:16-19
new(CrashDumpCommandLineOptions.CrashDumpFileNameOptionName, ..., ArgumentArity.ExactlyOne, false),
new(CrashDumpCommandLineOptions.CrashDumpTypeOptionName, ..., ArgumentArity.ExactlyOne, false)
Q:\src\testfx\src\Platform\Microsoft.Testing.Extensions.CrashDump\CrashDumpCommandLineProvider.cs:48-52
=> commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashReportOptionName)
... ? ValidationResult.InvalidTask(...) : ValidationResult.ValidTask;
Q:\src\testfx\src\Platform\Microsoft.Testing.Extensions.CrashDump\CrashDumpEnvironmentVariableProvider.cs:56-60
(_commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashDumpOptionName) ||
_commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashReportOptionName)) &&
_crashDumpGeneratorConfiguration.Enable
For comparison, HangDump already validates the same pattern:
Q:\src\testfx\src\Platform\Microsoft.Testing.Extensions.HangDump\HangDumpCommandLineProvider.cs:63-69
(commandLineOptions.IsOptionSet(HangDumpTimeoutOptionName) || ... ) && !commandLineOptions.IsOptionSet(HangDumpOptionName)
? ValidationResult.InvalidTask(ExtensionResources.MissingHangDumpMainOption)
Why this is a real issue
A user can pass --crashdump-filename or --crashdump-type and get no validation error, but the crash dump environment-variable provider never activates unless --crashdump or --crash-report is also set. That makes the options look accepted even though they have no effect.
Suggested resolution
Add ValidateCommandLineOptionsAsync validation equivalent to HangDump, so --crashdump-filename / --crashdump-type require --crashdump or --crash-report. Add acceptance/unit coverage for the invalid combinations.
Related issues
Summary
Microsoft.Testing.Extensions.CrashDumpaccepts--crashdump-filenameand--crashdump-typewithout requiring--crashdumpor--crash-report. UnlikeHangDump, those sub-options are not rejected when the main feature is off, so they are silently ignored.Evidence
Q:\src\testfx\src\Platform\Microsoft.Testing.Extensions.CrashDump\CrashDumpCommandLineProvider.cs:16-19new(CrashDumpCommandLineOptions.CrashDumpFileNameOptionName, ..., ArgumentArity.ExactlyOne, false),new(CrashDumpCommandLineOptions.CrashDumpTypeOptionName, ..., ArgumentArity.ExactlyOne, false)Q:\src\testfx\src\Platform\Microsoft.Testing.Extensions.CrashDump\CrashDumpCommandLineProvider.cs:48-52=> commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashReportOptionName)... ? ValidationResult.InvalidTask(...) : ValidationResult.ValidTask;Q:\src\testfx\src\Platform\Microsoft.Testing.Extensions.CrashDump\CrashDumpEnvironmentVariableProvider.cs:56-60(_commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashDumpOptionName) ||_commandLineOptions.IsOptionSet(CrashDumpCommandLineOptions.CrashReportOptionName)) &&_crashDumpGeneratorConfiguration.EnableFor comparison,
HangDumpalready validates the same pattern:Q:\src\testfx\src\Platform\Microsoft.Testing.Extensions.HangDump\HangDumpCommandLineProvider.cs:63-69(commandLineOptions.IsOptionSet(HangDumpTimeoutOptionName) || ... ) && !commandLineOptions.IsOptionSet(HangDumpOptionName)? ValidationResult.InvalidTask(ExtensionResources.MissingHangDumpMainOption)Why this is a real issue
A user can pass
--crashdump-filenameor--crashdump-typeand get no validation error, but the crash dump environment-variable provider never activates unless--crashdumpor--crash-reportis also set. That makes the options look accepted even though they have no effect.Suggested resolution
Add
ValidateCommandLineOptionsAsyncvalidation equivalent toHangDump, so--crashdump-filename/--crashdump-typerequire--crashdumpor--crash-report. Add acceptance/unit coverage for the invalid combinations.Related issues