-
Notifications
You must be signed in to change notification settings - Fork 341
Multi Target Trx Issue : LogFilePrefix Parameter Added #2140
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
Changes from 2 commits
920391e
e33f5ce
c67a8cc
ca47c42
a880dc7
c0739ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ namespace Microsoft.VisualStudio.TestPlatform.Extensions.TrxLogger | |
| using Microsoft.VisualStudio.TestPlatform.ObjectModel; | ||
| using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; | ||
| using Microsoft.VisualStudio.TestPlatform.Utilities; | ||
| using NuGet.Frameworks; | ||
| using ObjectModel.Logging; | ||
| using TrxLoggerConstants = Microsoft.TestPlatform.Extensions.TrxLogger.Utility.Constants; | ||
| using TrxLoggerObjectModel = Microsoft.TestPlatform.Extensions.TrxLogger.ObjectModel; | ||
|
|
@@ -443,14 +444,27 @@ private void DeriveTrxFilePath() | |
| { | ||
| if (this.parametersDictionary != null) | ||
| { | ||
vagisha-nidhi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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); | ||
|
||
|
|
||
| if (isLogFilePrefixParameterExists && !string.IsNullOrWhiteSpace(logFilePrefixValue)) | ||
| { | ||
| this.trxFilePath = Path.Combine(this.testResultsDirPath, logFileNameValue); | ||
| var framework = this.parametersDictionary[DefaultLoggerParameterNames.TargetFramework] ?? string.Empty; | ||
| framework = NuGetFramework.Parse(framework).GetShortFolderName(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can this cause invalid chars in file path? |
||
|
|
||
| logFilePrefixValue = logFilePrefixValue.Replace(".trx", string.Empty) + "_" + framework + DateTime.Now.ToString("_yyyyMMddHHmmssfff", DateTimeFormatInfo.InvariantInfo) + ".trx"; | ||
vagisha-nidhi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| this.trxFilePath = Path.Combine(this.testResultsDirPath, logFilePrefixValue); | ||
| } | ||
| else | ||
| { | ||
| this.SetDefaultTrxFilePath(); | ||
| var isLogFileNameParameterExists = this.parametersDictionary.TryGetValue(TrxLoggerConstants.LogFileNameKey, out string logFileNameValue); | ||
| if (isLogFileNameParameterExists && !string.IsNullOrWhiteSpace(logFileNameValue)) | ||
| { | ||
| this.trxFilePath = Path.Combine(this.testResultsDirPath, logFileNameValue); | ||
| } | ||
| else | ||
| { | ||
| this.SetDefaultTrxFilePath(); | ||
| } | ||
| } | ||
| } | ||
| else | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.