Monday, 15 June 2015

TFS run unit tests failing because of missing files -



TFS run unit tests failing because of missing files -

i have big code base of operations in tfs has multiple .sln files, each many projects , @ to the lowest degree 1 unit test project. of unit tests rely on mutual xml , xsd files, , there several other types of files (.config, .xaml, etc) needed code when unit testing.

because of way tfs builds , gathers files unit testing, of files missing testresults folder, tests failing during our ci builds [this has been happening while, i'm new project, , trying prepare errors]. tfs appears this: first, checks out code src folder (with solution1, solution2, etc) , builds it, developers locally. second, copies build outputs bin\binaries folder. third, looks test.dll files, copies them , dependencies (but dependencies), plus app.config file testresults\deploy_[date/time]\out folder, , runs unit tests there.

i encountering 2 problems this. because sec step combining build outputs 1 folder, files duplicate names overwriting each other. so, there 1 app.config file, though each solution has own. happening other config/xml files too, , 2 poorly named unit test .dlls. can live if have because of config files duplicates, , other files can renamed.

the sec problem of files don't create testresults folder, , when aren't there unit tests fail. know using [deploymentitem] attribute; if solution, go route, there many files looking different approach.

so question is, how can configure tfs-run builds & unit tests include of files need, without work & maintenance problems of adding lot of [deploymentitem] attributes, , without affecting local builds & unit tests developers?

update

one thing i've found adding [deploymentitem] attribute unit test causes deployment folder used. without that, runs unit tests in binaries folder. see http://msdn.microsoft.com/en-us/library/ms182475.aspx, under "when separate deployment folder used?"

also on page, says can specify files deploy in .testsettings file, says should avoid using because tests run slower. newer alternative, .runsettings file, not allow list files deploy.

it appears deployment becomes enabled if code coverage enabled, don't do, plan 1 time tests passing.

in tfs 2013 can execute powershell pre-test organize files in way need. can files deployed advertisement part of tests test settings file pre2013.

if test setting file not plenty can utilize community build tools phone call powershell straight in previous versions 2013.

if stuck on 2012 need utilize .testsettings file force bits need. yes create build slower that's selection other customising build process above.

unit-testing tfs tfsbuild vs-unit-testing-framework

No comments:

Post a Comment