-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi Target Trx Issue : LogFilePrefix Parameter Added #2140
Multi Target Trx Issue : LogFilePrefix Parameter Added #2140
Conversation
src/Microsoft.TestPlatform.Common/Utilities/RunSettingsUtilities.cs
Outdated
Show resolved
Hide resolved
@@ -443,14 +444,27 @@ private void DeriveTrxFilePath() | |||
{ | |||
if (this.parametersDictionary != null) | |||
{ | |||
var isLogFileNameParameterExists = this.parametersDictionary.TryGetValue(TrxLoggerConstants.LogFileNameKey, out string logFileNameValue); | |||
if (isLogFileNameParameterExists && !string.IsNullOrWhiteSpace(logFileNameValue)) | |||
var isLogFilePrefixParameterExists = this.parametersDictionary.TryGetValue(TrxLoggerConstants.LogFilePrefixKey, out string logFilePrefixValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can someone give both logFilePrefix and LogFileName ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will throw in logger initialize in such case
src/Microsoft.TestPlatform.Extensions.TrxLogger/ObjectModel/TestRun.cs
Outdated
Show resolved
Hide resolved
{ | ||
this.trxFilePath = Path.Combine(this.testResultsDirPath, logFileNameValue); | ||
var framework = this.parametersDictionary[DefaultLoggerParameterNames.TargetFramework] ?? string.Empty; | ||
framework = NuGetFramework.Parse(framework).GetShortFolderName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this cause invalid chars in file path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…i/vstest into MultiTargetTrxIssue
@vagisha-nidhi @hvinett We will need this for the html logger as well, Can you guys sync up on this. |
Description
RFC: microsoft/vstest-docs#204
Adding LogFilePrefix parameter to specify trx name prefix.
When this parameter is specified as
dotnet test --logger:"trx;LogFilePrefix=results"
, the prefix will be appended with target framework and timestamp generating a unique trx file for every target.Example:
E:\TestResults\results_net451_2018_12-24_14-01-07-176.trx
Timestamp is appended with milli seconds precision.
Related issue
#1603