How to both package with msbuild and run tests on TFS 2010 using Continuous Integration

天涯浪子 提交于 2019-12-22 09:39:21

问题


I am using TFS2010 and MSBuild to integrate a windows azure cloud solution to the CI.

To create the required 2 files for deployment I added in the "MSBuild Arguments" the /t:Publish

Here is the configuration I use in TFS to build the packages:

Problem is : if I remove all arguments the tests are built correctly but no azure package is built as seen on the build results:

Tho if I put the parameters the package is there but the test are not run :

Is there a way to have both ?


回答1:


I had discussion about your problem with TFS Team and I was told that as of now with TFS2010 this functionality is not yet fully supported however such functionality is in they radar and could be part of future TFS releases.

Because you are using TFS 2010, here are a few pointers that could help:

  • Building and Deploying Windows Azure Projects using MSBuild and TFS 2010
  • How-To: Deploy to Windows Azure from TFS Build using DeployToAzure



回答2:


I have managed to resolve this issue in my tfs build (TFS 2013). I am setting my MSBuild Argument target as /t:Publish;Build

Basically, during Publish target the unit test project is not being built. The 'Build' target builds the unit test project and my tests are executed. I also noted that the sequence of 'Publish' and then 'Build' was important. Setting 'Build' target before 'Publish' raised a few errors for my build.




回答3:


This problem still exists in TFS 2013. I work around it by creating a Makefile project in the solution, and add a new 'Makefile' file with content as

all:
    msbuild $(SolutionDir)AzureProject\AzureProject.ccproj /p:TargetProfile=Cloud /t:Publish /p:Configuration=$(Configuration) /p:PublishDir=$(OutDir)

And set build command line in project property page

nmake /E SolutionDir=$(SolutionDir) /E Configuration=$(Configuration) /E OutDir=$(OutDir)


来源:https://stackoverflow.com/questions/10904188/how-to-both-package-with-msbuild-and-run-tests-on-tfs-2010-using-continuous-inte

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!