Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSTest Projects in Visual Studio: which files to commit to version control?

For the first time, I've added a MSTest project to my Visual Studio solution in order to do some unit testing. I wanted to commit the solution to our source code repository, but there are a bunch of new file types - I'm not sure whether to add them to the repository or not. Can you help me?

New files:

  • Local.testsettings
  • Projectname.vsmdi
  • TraceAndTestImpact.testsettings
  • A few TestResults/machinename.trx

Thank you

like image 341
alapeno Avatar asked Oct 08 '22 02:10

alapeno


1 Answers

You only will want to check in what you need for running the tests, e.g. for automated runs of your unit tests in a CI (Continuous Integration) environment or manually on a developer's machine. For that

  • Local.testsettings
  • Projectname.vsmdi
  • TraceAndTestImpact.testsettings

are needed, otherwise MSTest will fail if running on a CI server (e.g. at least for Cruise Control running MSTest as a exec task as part of a build) or silently generate those files (if running MSTest integrated with Visual Studio on a developer's box).

Actual historical test result data is not really useful for version control, especially if you are just interested in "all tests are green" - otherwise your build is broken anyway.

like image 75
BrokenGlass Avatar answered Oct 12 '22 12:10

BrokenGlass