0

We have a TFS gated check-in which uses MSTest workflow activity for running our unit tests. We came across some issues recently due to the result folder that MSTest activity creates being too long so some of our unit tests are failing now because of that. It looks it uses a patter like <user>_<machine_name> <date> <time>_<platform>_<config> so we see very lengthy directory names like "tfsbuild_machine123 2015-09-10 10_00_00_Any CPU_Debug". I did some digging into the workflow and its options but couldn't identify where this pattern is coming from. I appreciate if someone can please point me to where this is coming from and how I can change it so we get more room for our unit testing.

tecfield
  • 203
  • 2
  • 11
  • Can you show me the detailed error message you get? And what is the test result folder you're referring to? Do you mean the test result hyperlink on the TFS build summary page? If so, please check my answer below. – Vicky - MSFT Sep 15 '15 at 10:09
  • our functional unit testing is set to generate random data at runtime and perform tests against them. Files and folders are all random even the names. In order to figure out what caused a test to fail we create files in an organized way. We recently mentioned that some tests are failing on simple things like Directory.Move. When I checked the logic, inside all those IO helpers there is logic that raises a PathTooLong exception if a file full path exceeds 248 chars. Even if you use relative passing, still it tries to get full path under the hood first and hence it fails. – tecfield Sep 17 '15 at 18:16
  • Then I mentioned that a huge portion of that path is taken by that ridiculously long folder name that MSTest creates to deploy test assemblies and contents begin with! Then I mention that the workflow specifies root test output folder but MSTest creates its own gigantic folder name within that. – tecfield Sep 17 '15 at 18:20

1 Answers1

0

I assume that you're referring to test part in the Build Summary page. Like:

enter image description here

As far as I know that the Summary part in the Build Summary page actually is a SummaryFactory type which drives from IBuildDetailFactory, it is not defined in the TFS build process template. The SummaryFactory class contains some functions like CreateSections and CreateNodes which are used to create nodes with on the Summary page, for example, a hyperlink with the format<user>_<machine_name> <date> <time>_<platform>_<config> . However, the SummaryFactory.cs is an internal class so you can't use it in your own program, nor to customize the test hyperlink format.

For your issue, I still would like to check the detailed error message to see what's wrong with it.

Vicky - MSFT
  • 4,970
  • 1
  • 14
  • 22
  • nope! on the build server, when the build contains tests to be run, the runtime creates a folder inside the root folder that you pass to the workflow. That folder has a very very long name as I mentioned in my original post. I am wondering that if that format can be changed or at least direct MSTest to not create its own folder withing the root folder specified by user. – tecfield Sep 17 '15 at 18:10