Skip to content
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

Several problems are being caused by the new log file name timestamp #1978

Closed
jnm2 opened this issue Apr 4, 2019 · 10 comments
Closed

Several problems are being caused by the new log file name timestamp #1978

jnm2 opened this issue Apr 4, 2019 · 10 comments
Labels
enhancement needs-triage This item should be discussed in the next triage meeting.

Comments

@jnm2
Copy link

jnm2 commented Apr 4, 2019

#1877 is causing problems.

  • VSTest inventing directories that don't exist because the string.Replace is hitting all containing directory names, not just the file name.
  • The filename is unsightly and there's no way to turn this off.
  • Our CI scripts have to guess at the resulting filename based on the directory listing or else direct VSTest to a temp folder and copy TRX files back out with proper filenames.
@mayankbansal018
Copy link
Contributor

@jnm2 we are looking at this issue, & re-designing on how we should handle the results at dotnet sln(multiple test project / multi target test project) level.

We are not reverting the fix done earlier immediately, as it might cause confusion for those whose trx are getting published.

We will publish an RFC once we have a design in place, before implementing it.

@jnm2
Copy link
Author

jnm2 commented Apr 5, 2019

Good to know. I'd love if there was a way for the TRX format to be enhanced so that a single file can contain all the results for each target framework. Projects that use TRX would be able to follow the <multi-project run name>.trx pattern that is possible with NUnit XML.

Second-best would be <multi-project run name>.netstandard2.0.trx etc, but that puts a burden on our CI scripts to play catch-up with our projects' changing TFMs over time. It's not very maintainable from that perspective.

@jcoburn
Copy link

jcoburn commented Apr 11, 2019

well maybe you could use the existing feature?
--logger "rx;LogFileName=Framework.trx" for framework

--logger "rx;LogFileName=Core2_1.trx" for Core 2.1

--logger "rx;LogFileName=Core2_2.trx" for Core 2.2

this change broke all of my multi-targeted builds!

@jnm2
Copy link
Author

jnm2 commented Apr 12, 2019

well maybe you could use the existing feature?

How would my build script know which TFMs to use? They change pretty often. This is additional pain.

@singhsarab
Copy link
Contributor

@vagisha-nidhi Can you please link the RFC for this fix and also release when it is available.

@drognanar
Copy link
Member

Tagging @AbhitejJohn

@AbhitejJohn AbhitejJohn self-assigned this Jan 23, 2020
@0xced
Copy link

0xced commented Sep 13, 2021

#1877 was reverted in #1996 so that fixes the log file name timestamp part of the issue.

Being able to run tests on multiple frameworks and collect the results is unfortunately not yet solved, though.

See also #1876 which is related to this issue. If the [targetFramework] template is implemented as proposed, it could solve the problem of running tests on multiple frameworks by producing one test results file per target framework.

@Evangelink Evangelink added the needs-triage This item should be discussed in the next triage meeting. label Aug 1, 2022
@Evangelink Evangelink self-assigned this Aug 2, 2022
@Evangelink
Copy link
Member

Note to self: test if problem still exists

@0xced
Copy link

0xced commented Apr 29, 2023

Cross-posting my comment from #1876 which can workaround this issue by defining the test logger parameters as MSBuild properties, where you have access to the target framework and the project name.

I recently learnt that you can control the loggers through MSBuild properties instead of dotnet test arguments. Thus it becomes easy to craft the log file name of your choice. Here's what I have added to the Directory.Build.props file in my tests directory:

<ItemGroup>
  <VSTestLogger Include="trx%3BLogFileName=TestResults-$(TargetFramework)-$(MSBuildProjectName).trx" />
  <VSTestLogger Include="html%3BLogFileName=TestResults-$(TargetFramework)-$(MSBuildProjectName).html" />
</ItemGroup>

<PropertyGroup Condition="$(ContinuousIntegrationBuild) == 'true'">
  <VSTestResultsDirectory>$(MSBuildThisFileDirectory)\..</VSTestResultsDirectory>
  <VSTestLogger>@(VSTestLogger)</VSTestLogger>
</PropertyGroup>

@Evangelink Evangelink removed their assignment Apr 2, 2024
@nohwnd
Copy link
Member

nohwnd commented Jul 9, 2024

Workaround is provided.

@nohwnd nohwnd closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs-triage This item should be discussed in the next triage meeting.
Projects
None yet
Development

No branches or pull requests

10 participants