question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Avoid guid at the end of outputDirectory

See original GitHub issue

On Coverlet we have some users complain about the dynamic folder name generated for reports file. I did some check on code and seem that guid is “mandatory” and not removable.

https://github.com/microsoft/vstest/blob/master/src/Microsoft.TestPlatform.Common/DataCollection/DataCollectionAttachmentManager.cs#L101-L125

Could be useful add a parameter, maybe in runsetting like <DeterministicOutputdirectory>true/false</DeterministicOutputdirectory> and in that case avoid to concat guid.ToString().

Dynamic folder makes CI more complex.

Issues refs https://github.com/tonerdo/coverlet/issues/500 https://github.com/tonerdo/coverlet/issues/767

cc: @DaleyKD

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:70
  • Comments:45 (21 by maintainers)

github_iconTop GitHub Comments

27reactions
keegandentcommented, May 29, 2021

This is also not IDE friendly, as there is no deterministic way to find the most recent result folder. Coverage highlighting tools (VSCode Coverage Gutters, in my case) can’t be effectively configured to work with this behavior.

I am right there with you. I’m not sure what genius thought an artifact directory’s name should be non-deterministic, but it’s completely ludicrous to me. Nobody has, from my reading, presented a single good argument as to why you’d want a GUID for this. I could see the argument for a timestamp, but honestly, if somebody wants their artifacts in a GUID-named folder, make them do it themselves as its a lot easier to go deterministic->random than vice-versa. I’m not sure why those who want consistency are the ones being punished.

25reactions
ViktorHofercommented, Apr 22, 2020

Just stumbled upon this.

I don’t know the reasons for the guid but I would rather avoid yet another option.

I disagree. VSTest should respect the specified ResultsDirectory and CoverageFileName for data collectors and not create intermediate directories between. I can do that for loggers already so I would argue DataCollectors to behave the same:

<RunSettings>
  <RunConfiguration>
     <!-- Directory for test run reports. E.g. trx, coverage etc. -->
    <ResultsDirectory>.\</ResultsDirectory>
  </RunConfiguration>
  <LoggerRunSettings>
    <Loggers>
      <Logger uri="logger://Microsoft/TestPlatform/TrxLogger/v1">
        <Configuration>
          <LogFileName>testResults.trx</LogFileName>
        </Configuration>
      </Logger>
      <Logger uri="logger://Microsoft/TestPlatform/HtmlLogger/v1">
        <Configuration>
          <LogFileName>testResults.html</LogFileName>
        </Configuration>
      </Logger>
    </Loggers>
  </LoggerRunSettings>

I would expect the following behavior:

  • LogFileName inside a DataCollector configuration node is respected:
<DataCollectionRunSettings>
    <DataCollectors>
      <DataCollector friendlyName="XPlat code coverage">
        <Configuration>
          <CoverageFileName>coverage.xml</CoverageFileName>
        </Configuration>
      </DataCollector>
    </DataCollectors>
  </DataCollectionRunSettings>
  • The specified ResultsDirectory is respected without any intermediate folders in it.
  <RunConfiguration>
     <!-- Directory for test run reports. E.g. trx, coverage etc. -->
    <ResultsDirectory>.\</ResultsDirectory>
  </RunConfiguration>

In this example you can even see that coverage is explicitly listed in the comment (which I took from the docs). Specifying the log file name seems to have worked in the past with the pre-coverlet code coverage collector: https://github.com/microsoft/vstest/issues/1957.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to specify output directory when using VSTest ...
Unable to specify output directory when using VSTest integration? #500 ... Avoid guid at the end of outputDirectory microsoft/vstest#2378.
Read more >
VS Project References Broken On Case Sensitivity of GUID
Generated GUIDs for class library projects are initially lower case with no braces. If a new project reference is added a class library...
Read more >
7 Collecting Target Configuration Data
output directory :Directory to contain the generated resource files. If not specified, then the resource files are generated in the current directory.
Read more >
Advanced Tab
Advanced Tab ; Patch GUID. The patch GUID is used to uniquely identify a patch package. InstallShield automatically generates a new GUID for...
Read more >
Hitchhiker's Guide to Robocopy: Examples, options ... - PDQ
Will not output directory names as they are copied. /NP, No Progress - don't display percentage copied. Robocopy displays the progress of a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found