You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var commandLineOptions = ServiceProvider.GetCommandLineOptions();
var serverMode = commandLineOptions.IsOptionSet("server");
Edit
I've confirmed it can get this information via ICommandLineOptions.
But when using this API, it need manually check testconfig.json setting also.
var commandLineOptions = serviceProvider.GetCommandLineOptions();
var isDiagnosticEnabled = commandLineOptions.IsOptionSet("diagnostic");
bool isSuccess = commandLineOptions.TryGetOptionArgumentList("diagnostic-output-directory", out var values);
2. Gets diagnostic log file path
FileLogger is declared as internal.
So it can't get output path from ILogger without reflection.
I want some APIs for getting following information
diagnostic is enabled or not
Outputted diagnostic log file path.
Background
When running MTP tests with VS Test Explorer. --diagnostic argument is implicitly specified. and log file is generated on every test runs.
But this information is not shown VS Output window.
So I want to print this information when running test on custom MTP extensions.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to gets following information inside MTP extension.
--diagnostic-output-directoryargument.But these data seems not exposed to MTP extensions.
Because following limitation exists.
1.Gets
diagnostic log directorythat is specified with--diagnostic-output-directoryargument.It seems this information can't get via
IConfiguration.Because command line arguments is not registered as
ConfigurationProvider.And getting only some pre-defined arguments supported.
testfx/src/Platform/Microsoft.Testing.Platform/Configurations/AggregatedConfiguration.cs
Lines 29 to 39 in 689dd23
var commandLineOptions = ServiceProvider.GetCommandLineOptions();
var serverMode = commandLineOptions.IsOptionSet("server");
Edit
I've confirmed it can get this information via
ICommandLineOptions.But when using this API, it need manually check
testconfig.jsonsetting also.2. Gets
diagnostic log file pathFileLoggeris declared as internal.So it can't get output path from ILogger without reflection.
I want some APIs for getting following information
diagnosticis enabled or notBackground
When running MTP tests with VS Test Explorer.
--diagnosticargument is implicitly specified. and log file is generated on every test runs.But this information is not shown VS Output window.
So I want to print this information when running test on custom MTP extensions.
Beta Was this translation helpful? Give feedback.
All reactions