feat: Add template placeholders for assembly, framework, date, time, … #15334
+0
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds support for dynamic template replacement in TRX log file names and prefixes. Users can now use placeholders such as
{assembly},{framework},{date},{time},{machine},{user}, and{configuration}in the log file name or prefix parameters, and these will be replaced with the corresponding runtime values. The implementation includes robust, case-insensitive replacement logic and comprehensive unit tests to verify correct behavior for all supported templates, including handling of missing values and multiple templates.Template Replacement Feature:
_assemblyName,_targetFramework,_configuration) toTrxLoggerto capture values for template replacement.ProcessTemplateReplacementsmethod inTrxLoggerto perform case-insensitive, multi-template replacement in log file name and prefix patterns.TestResultHandlerandAcquireTrxFileNamePathto capture assembly name, target framework, and configuration for use in template replacement, and applied template processing to log file name and prefix parameters. [1] [2]TrxLoggerConstants(Constants.cs).Testing and Validation:
TrxLoggerTests.csto verify template replacement for all supported placeholders, case insensitivity, handling of unknown values, and correct behavior with multiple templates in both log file name and prefix.…machine, user, and configuration in TrxLogger file namingDescription
Please add a meaningful description for this change.
Ensure the PR has required unit tests.
Related issue
Kindly link any related issues. E.g. Fixes #xyz.