diff --git a/src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs b/src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs index 5f1b3f192b..626941c9b8 100644 --- a/src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs +++ b/src/Platform/Microsoft.Testing.Platform/CommandLine/PlatformCommandLineProvider.cs @@ -15,10 +15,10 @@ internal sealed class PlatformCommandLineProvider : ICommandLineOptionsProvider public const string TimeoutOptionKey = "timeout"; public const string InfoOptionKey = "info"; public const string DiagnosticOptionKey = "diagnostic"; - public const string DiagnosticOutputFilePrefixOptionKey = "diagnostic-output-fileprefix"; + public const string DiagnosticOutputFilePrefixOptionKey = "diagnostic-file-prefix"; public const string DiagnosticOutputDirectoryOptionKey = "diagnostic-output-directory"; public const string DiagnosticVerbosityOptionKey = "diagnostic-verbosity"; - public const string DiagnosticFileLoggerSynchronousWriteOptionKey = "diagnostic-filelogger-synchronouswrite"; + public const string DiagnosticFileLoggerSynchronousWriteOptionKey = "diagnostic-synchronous-write"; public const string NoBannerOptionKey = "no-banner"; public const string SkipBuildersNumberCheckOptionKey = "internal-testingplatform-skipbuildercheck"; public const string DiscoverTestsOptionKey = "list-tests"; diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index 8d8896cb3d..380b507378 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -13,7 +13,7 @@ Recommended - $(TestingPlatformCommandLineArguments) --diagnostic --diagnostic-output-directory $(RepoRoot)artifacts/log/$(Configuration) --diagnostic-output-fileprefix $(ModuleName) --diagnostic-verbosity trace + $(TestingPlatformCommandLineArguments) --diagnostic --diagnostic-output-directory $(RepoRoot)artifacts/log/$(Configuration) --diagnostic-file-prefix $(ModuleName) --diagnostic-verbosity trace $(TestingPlatformCommandLineArguments) --crashdump $(TestingPlatformCommandLineArguments) --hangdump --hangdump-timeout 15m $(TestingPlatformCommandLineArguments) --report-azdo diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs index f65ad6d7c4..1aeb34b302 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/HelpInfoTests.cs @@ -31,15 +31,15 @@ Specifies a testconfig.json file. --diagnostic Enable the diagnostic logging. The default log level is 'Trace'. The file will be written in the output directory with the name log_[yyMMddHHmmssfff].diag - --diagnostic-filelogger-synchronouswrite - Force the built-in file logger to write the log synchronously. - Useful for scenario where you don't want to lose any log (i.e. in case of crash). - Note that this is slowing down the test execution. + --diagnostic-file-prefix + Prefix for the log file name that will replace '[log]_.' --diagnostic-output-directory Output directory of the diagnostic logging. If not specified the file will be generated inside the default 'TestResults' directory. - --diagnostic-output-fileprefix - Prefix for the log file name that will replace '[log]_.' + --diagnostic-synchronous-write + Force the built-in file logger to write the log synchronously. + Useful for scenario where you don't want to lose any log (i.e. in case of crash). + Note that this is slowing down the test execution. --diagnostic-verbosity Define the level of the verbosity for the --diagnostic. The available values are 'Trace', 'Debug', 'Information', 'Warning', 'Error', and 'Critical'. diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs index d0dae9f7c3..050b43464e 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/DiagnosticTests.cs @@ -31,7 +31,7 @@ public async Task Diag_WhenDiagnosticAndOutputFilePrefixAreSpecified_ReportIsGen string diagPathPattern = Path.Combine(diagPath, @"abcd_.*.diag").Replace(@"\", @"\\"); var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, AssetName, tfm); - TestHostResult testHostResult = await testHost.ExecuteAsync("--diagnostic --diagnostic-output-fileprefix abcd"); + TestHostResult testHostResult = await testHost.ExecuteAsync("--diagnostic --diagnostic-file-prefix abcd"); await AssertDiagnosticReportWasGeneratedAsync(testHostResult, diagPathPattern); } @@ -61,7 +61,7 @@ public async Task Diag_WhenDiagnosticAndOutputFilePrefixAndOutputDirectoryAreSpe Assert.IsTrue(Directory.CreateDirectory(diagPath).Exists); var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, AssetName, tfm); - TestHostResult testHostResult = await testHost.ExecuteAsync($"--diagnostic --diagnostic-output-fileprefix abcde --diagnostic-output-directory {diagPath}"); + TestHostResult testHostResult = await testHost.ExecuteAsync($"--diagnostic --diagnostic-file-prefix abcde --diagnostic-output-directory {diagPath}"); await AssertDiagnosticReportWasGeneratedAsync(testHostResult, diagPathPattern); } @@ -71,10 +71,10 @@ public async Task Diag_WhenDiagnosticAndOutputFilePrefixAndOutputDirectoryAreSpe public async Task Diag_WhenDiagnosticOutputFilePrefixButNotDiagnosticIsSpecified_ReportGenerationFails(string tfm) { var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, AssetName, tfm); - TestHostResult testHostResult = await testHost.ExecuteAsync("--diagnostic-output-fileprefix cccc"); + TestHostResult testHostResult = await testHost.ExecuteAsync("--diagnostic-file-prefix cccc"); testHostResult.AssertExitCodeIs(ExitCodes.InvalidCommandLine); - testHostResult.AssertOutputContains("'--diagnostic-output-fileprefix' requires '--diagnostic' to be provided"); + testHostResult.AssertOutputContains("'--diagnostic-file-prefix' requires '--diagnostic' to be provided"); } [DynamicData(nameof(TargetFrameworks.AllForDynamicData), typeof(TargetFrameworks))] @@ -93,7 +93,7 @@ public async Task Diag_WhenDiagnosticOutputDirectoryButNotDiagnosticIsSpecified_ public async Task Diag_WhenDiagnosticFilePrefixAndDiagnosticOutputDirectoryButNotDiagnosticAreSpecified_ReportGenerationFails(string tfm) { var testHost = TestInfrastructure.TestHost.LocateFrom(AssetFixture.TargetAssetPath, AssetName, tfm); - TestHostResult testHostResult = await testHost.ExecuteAsync("--diagnostic-output-fileprefix aaaa --diagnostic-output-directory cccc"); + TestHostResult testHostResult = await testHost.ExecuteAsync("--diagnostic-file-prefix aaaa --diagnostic-output-directory cccc"); testHostResult.AssertExitCodeIs(ExitCodes.InvalidCommandLine); testHostResult.AssertOutputContains("'--diagnostic-output-directory' requires '--diagnostic' to be provided"); diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs index 1956c917fc..624453b1d9 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs @@ -25,15 +25,15 @@ Specifies a testconfig.json file. --diagnostic Enable the diagnostic logging. The default log level is 'Trace'. The file will be written in the output directory with the name log_[yyMMddHHmmssfff].diag - --diagnostic-filelogger-synchronouswrite - Force the built-in file logger to write the log synchronously. - Useful for scenario where you don't want to lose any log (i.e. in case of crash). - Note that this is slowing down the test execution. + --diagnostic-file-prefix + Prefix for the log file name that will replace '[log]_.' --diagnostic-output-directory Output directory of the diagnostic logging. If not specified the file will be generated inside the default 'TestResults' directory. - --diagnostic-output-fileprefix - Prefix for the log file name that will replace '[log]_.' + --diagnostic-synchronous-write + Force the built-in file logger to write the log synchronously. + Useful for scenario where you don't want to lose any log (i.e. in case of crash). + Note that this is slowing down the test execution. --diagnostic-verbosity Define the level of the verbosity for the --diagnostic. The available values are 'Trace', 'Debug', 'Information', 'Warning', 'Error', and 'Critical'. @@ -148,7 +148,7 @@ Microsoft.Testing.Platform v.+ \[.+\] Arity: 1 Hidden: True Description: Specify the port of the client\. - --config-file + --config-file Arity: 1 Hidden: False Description: Specifies a testconfig\.json file\. @@ -157,21 +157,21 @@ Microsoft.Testing.Platform v.+ \[.+\] Hidden: False Description: Enable the diagnostic logging\. The default log level is 'Trace'\. The file will be written in the output directory with the name log_\[yyMMddHHmmssfff\]\.diag - --diagnostic-filelogger-synchronouswrite - Arity: 0 + --diagnostic-file-prefix + Arity: 1 Hidden: False - Description: Force the built-in file logger to write the log synchronously\. - Useful for scenario where you don't want to lose any log \(i\.e\. in case of crash\)\. - Note that this is slowing down the test execution\. + Description: Prefix for the log file name that will replace '\[log\]_\.' --diagnostic-output-directory Arity: 1 Hidden: False Description: Output directory of the diagnostic logging. If not specified the file will be generated inside the default 'TestResults' directory\. - --diagnostic-output-fileprefix - Arity: 1 + --diagnostic-synchronous-write + Arity: 0 Hidden: False - Description: Prefix for the log file name that will replace '\[log\]_\.' + Description: Force the built-in file logger to write the log synchronously\. + Useful for scenario where you don't want to lose any log \(i\.e\. in case of crash\)\. + Note that this is slowing down the test execution\. --diagnostic-verbosity Arity: 1 Hidden: False @@ -282,15 +282,15 @@ Specifies a testconfig.json file. --diagnostic Enable the diagnostic logging. The default log level is 'Trace'. The file will be written in the output directory with the name log_[yyMMddHHmmssfff].diag - --diagnostic-filelogger-synchronouswrite - Force the built-in file logger to write the log synchronously. - Useful for scenario where you don't want to lose any log (i.e. in case of crash). - Note that this is slowing down the test execution. + --diagnostic-file-prefix + Prefix for the log file name that will replace '[log]_.' --diagnostic-output-directory Output directory of the diagnostic logging. If not specified the file will be generated inside the default 'TestResults' directory. - --diagnostic-output-fileprefix - Prefix for the log file name that will replace '[log]_.' + --diagnostic-synchronous-write + Force the built-in file logger to write the log synchronously. + Useful for scenario where you don't want to lose any log (i.e. in case of crash). + Note that this is slowing down the test execution. --diagnostic-verbosity Define the level of the verbosity for the --diagnostic. The available values are 'Trace', 'Debug', 'Information', 'Warning', 'Error', and 'Critical'. @@ -425,21 +425,21 @@ Microsoft.Testing.Platform v* [*] Hidden: False Description: Enable the diagnostic logging. The default log level is 'Trace'. The file will be written in the output directory with the name log_[yyMMddHHmmssfff].diag - --diagnostic-filelogger-synchronouswrite - Arity: 0 + --diagnostic-file-prefix + Arity: 1 Hidden: False - Description: Force the built-in file logger to write the log synchronously. - Useful for scenario where you don't want to lose any log (i.e. in case of crash). - Note that this is slowing down the test execution. + Description: Prefix for the log file name that will replace '[log]_.' --diagnostic-output-directory Arity: 1 Hidden: False Description: Output directory of the diagnostic logging. If not specified the file will be generated inside the default 'TestResults' directory. - --diagnostic-output-fileprefix - Arity: 1 + --diagnostic-synchronous-write + Arity: 0 Hidden: False - Description: Prefix for the log file name that will replace '[log]_.' + Description: Force the built-in file logger to write the log synchronously. + Useful for scenario where you don't want to lose any log (i.e. in case of crash). + Note that this is slowing down the test execution. --diagnostic-verbosity Arity: 1 Hidden: False