MSDN > 論壇首頁 > Microsoft Visual Studio Team Foundation Server 2010 Beta 2 > The MSTestActivity was invoked without a value for either TestMetadata or TestContainers.
發問發問
 

已答覆The MSTestActivity was invoked without a value for either TestMetadata or TestContainers.

  • Friday, 22 May, 2009 8:18Lars WilhelmsenMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hi,

     I've created a simple solution that I've checked into TFS (2010 beta1) and I've created a build type for continuous integration.

     Run Tests i set to true and I've assigned a testsettings file as well as a vsmdi file. When the build server build the projects, it
     runs the tests (it's actually right now only a single unit test / method) but it spits out the following error message after it finish
     the test run:

     The MSTestActivity was invoked without a value for either TestMetadata or TestContainers.

     How do I fix this?

     --larsw
    Lars Wilhelmsen | Senior Consultant | Miles, Norway | Connected Systems MVP | http://larswilhelmsen.com/
    • 已移動dougn-MSFTMSFT, 版主Wednesday, 27 May, 2009 13:00Team Build issue that we need to fix... (From:Microsoft Visual Studio Team System 2010 Beta 1)
    •  

解答

  • Monday, 25 May, 2009 15:34Karl Z 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    I finally got past this. I created a Test List called "Build". I then added ALL my tests to that test list and specified the Build test list rather than "Run all tests in this VSMDI file".

    At least a work around for me for Beta 1...

所有回覆

  • Friday, 22 May, 2009 11:24Anutthara - MSFT 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    Hey Lars - in the build definition "Process" tab there is an option to choose the test list to run. Have you chosen the right .vsmdi file and the test list to run as part of the build there?

    If not, point to your .vsmdi file and choose "run all tests" - that should give you test results on the build. HTH!

    - Anu   


    http://blogs.msdn.com/anutthara
  • Friday, 22 May, 2009 11:56Lars WilhelmsenMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hi Anutthara,

     Are you referring to the "Test Metadata Files" option in the property grid? If so, yes - I've assigned the default .vsmdi file that was generated
     when I added the Test project to the solution, and I selected the "Run all Tests" node.

     --larsw
    Lars Wilhelmsen | Senior Consultant | Miles, Norway | Connected Systems MVP | http://larswilhelmsen.com/
  • Monday, 25 May, 2009 15:34Karl Z 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    I finally got past this. I created a Test List called "Build". I then added ALL my tests to that test list and specified the Build test list rather than "Run all tests in this VSMDI file".

    At least a work around for me for Beta 1...
  • Monday, 25 May, 2009 17:56Lars WilhelmsenMVP使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hi Karl,

     Same thing worked for me - I just forgot to reply to this thread.

     --larsw
    Lars Wilhelmsen | Senior Consultant | Miles, Norway | Connected Systems MVP | http://larswilhelmsen.com/
  • Wednesday, 29 July, 2009 21:47Michael Heitland 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     包含代碼
    Hi, I tried the same but it did not work for me. I got the following error message: "'MSTest.exe' returned an unexpected exit code. Expected '0'; actual '1'." Extract from my Log file see below. Any Ideas? Cheers, Michael APPENDIX Run Tests 00:17 If Not TestProjects Is Nothing 00:17 For Each TestProject in TestProjects 00:16 Try Run Tests for TestProject 00:16 Run MSTest for Project 00:00 Convert Server Path to Local Path 00:16 Run MSTest for Project C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe /nologo /searchpathroot:"C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\1\ContinuousIntegrationDemo\BuildDefinition1\Binaries" /resultsfileroot:"C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\1\ContinuousIntegrationDemo\BuildDefinition1\TestResults" /testmetadata:"C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\1\ContinuousIntegrationDemo\BuildDefinition1\Sources\ContinuousIntegrationDemo1.vsmdi" /testlist:"MyTestList" /publish:"http://caa1747-2008v:8080/tfs/DefaultCollection" /publishbuild:"vstfs:///Build/Build/48" /teamproject:"ContinuousIntegrationDemo" /flavor:"Debug" No platform specified for publish operation. For switch syntax, type "MSTest /help" 00:00 Handle MSTest Exception 'MSTest.exe' returned an unexpected exit code. Expected '0'; actual '1'. 00:00 Set TestStatus to Failed
  • Monday, 28 September, 2009 15:50Cezary Nolewajka 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hi,

    The platform needs to be specified in the Build Definition, Process tab, Comilation section.

    the Configuration to Build needs to indicate both, configuration AND platform: Debug|Any CPU.

    Then, the Platform parameter for the MSTest.exe is passed from that configuration data.

    I hope this would help if someone is still looking for the answer.

    Best regards,
    Cezary Nolewajka