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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion test/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<MSTestAnalysisMode>Recommended</MSTestAnalysisMode>

<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --diagnostic --diagnostic-output-directory $(RepoRoot)artifacts/log/$(Configuration) --diagnostic-output-fileprefix $(ModuleName) --diagnostic-verbosity trace</TestingPlatformCommandLineArguments>
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --diagnostic --diagnostic-output-directory $(RepoRoot)artifacts/log/$(Configuration) --diagnostic-file-prefix $(ModuleName) --diagnostic-verbosity trace</TestingPlatformCommandLineArguments>
<TestingPlatformCommandLineArguments Condition=" $([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETCoreApp' ">$(TestingPlatformCommandLineArguments) --crashdump</TestingPlatformCommandLineArguments>
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --hangdump --hangdump-timeout 15m</TestingPlatformCommandLineArguments>
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --report-azdo</TestingPlatformCommandLineArguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand All @@ -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))]
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down Expand Up @@ -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\.
Expand All @@ -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
Expand Down Expand Up @@ -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'.
Expand Down Expand Up @@ -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
Expand Down