Allow customise test log output location
See original GitHub issue- This issue is blocking
- This issue is causing unreasonable pain
The solution I’m currently working consists of hundreds of projects (many of which a test projects). As a result the ./artifacts/logs folder gets filled with many *.log files (example). It makes it difficult to see other logs produced during the build. The paths are configured here: https://github.com/dotnet/arcade/blob/0978c75667efa5248017f7babab1ff966ab7e622/src/Microsoft.DotNet.Arcade.Sdk/tools/Tests.targets#L40-L68
I’m specifically interested in ResultsStdOutPath
, and it doesn’t look like the destination path can be easily customised (short of changing ArtifactsLogDir
variable).
May we entertain the following tweak?
<PropertyGroup>
<_TestArchitecture>%(_TestArchitectureItems.Identity)</_TestArchitecture>
<_ResultFileNameNoExt>$(MSBuildProjectName)_$(TargetFramework)_$(_TestArchitecture)</_ResultFileNameNoExt>
+ <TestResultsLogDir Condition=" '$(TestResultsLogDir)' == '' ">$(ArtifactsLogDir)</TestResultsLogDir>
</PropertyGroup>
<ItemGroup>
<TestToRun Include="$(TargetPath)">
<TargetFramework>$(TargetFramework)</TargetFramework>
<TargetFrameworkIdentifier>$(TargetFrameworkIdentifier)</TargetFrameworkIdentifier>
<TargetFrameworkVersion>$(TargetFrameworkVersion)</TargetFrameworkVersion>
<TestRuntime>$(TestRuntime)</TestRuntime>
<TestTimeout>$(TestTimeout)</TestTimeout>
<Architecture>$(_TestArchitecture)</Architecture>
<EnvironmentDisplay>$(TargetFramework)|$(_TestArchitecture)</EnvironmentDisplay>
<ResultsFilePathWithoutExtension>$(_ResultFileNameNoExt)</ResultsFilePathWithoutExtension>
<ResultsXmlPath>$(ArtifactsTestResultsDir)$(_ResultFileNameNoExt).xml</ResultsXmlPath>
<ResultsTrxPath>$(ArtifactsTestResultsDir)$(_ResultFileNameNoExt).trx</ResultsTrxPath>
<ResultsHtmlPath>$(ArtifactsTestResultsDir)$(_ResultFileNameNoExt).html</ResultsHtmlPath>
- <ResultsStdOutPath>$(ArtifactsLogDir)$(_ResultFileNameNoExt).log</ResultsStdOutPath>
+ <ResultsStdOutPath>$(TestResultsLogDir)$(_ResultFileNameNoExt).log</ResultsStdOutPath>
<TestRunnerAdditionalArguments>$(TestRunnerAdditionalArguments)</TestRunnerAdditionalArguments>
</TestToRun>
</ItemGroup>
</Target>
This way I can alter my solution’s config as this:
<PropertyGroup>
<TestResultsLogDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsLogDir)', 'TestLogs'))</TestResultsLogDir>
</PropertyGroup>
…and have tests in a subfolder:
Release Note Category
- Feature changes/additions
- Bug fixes
- Internal Infrastructure Improvements
Release Note Description
Issue Analytics
- State:
- Created 7 months ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Controlling output of Boost.Test source location format
This format doesn't allow my editor to recognize the output as a source location. Is there way to make Boost.Test output the source...
Read more >How to view log output while tests are running in VS 2019 ...
run a test · select the test in Test Explorer in VS · Click the "Open additional output for this result" link.
Read more >How to manage logging
Inside tests it is possible to change the log level for the captured log messages. This is supported by the caplog fixture:.
Read more >Plugin Development: Managing Log Output | Terraform
You can use environment variables to turn on logging, filter log output, choose the log format, and specify the log output path.
Read more >Explore test results | IntelliJ IDEA Documentation
The console on the right shows the output of the current test session. It allows you to see the detailed information on the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alright, after regenerating both tokens it seemed to work. Thank you for the suggestions.
I updated AzDO PAT, and still the same result…