locked
Test assemblies exclusion in team build RRS feed

  • Question

  • Hi,

    In my build definition I am building two separate solutions. Both solutions generate multiple dlls that qualify **\*Test*.dll, say FirstTest.dll, SecondTest.dll, ThirdTest.dll.

    Now I want to pick only FirstTest.dll, SecondTest.dll and exclude ThirdTest.dll from executing the test cases.

    Is it really possible ?

    Thanks.

    Tuesday, November 29, 2011 9:53 AM

Answers

  • Two ways to do this come to mind.

    First, you can, of course, modify the process template to simply exclude ThirdTest.dll. This will require some hard-coding of the test DLL's that are used in your project. When you open the process template in Visual Studio, you'll see, closer to the bottom, the process for doing the tests. That's where you'll make the changes.

    Second - and I think this is easier and more flexible - you can create a solution configuration for build that simply excludes (doesn't build) the ThirdTest.dll. You then specify these solution configurations for the build, rather than the default of "Debug" or "Release". This can be done in the build definition so it doesn't require any editing of the process template.


    DevBiker (aka J Sawyer)
    My Blog
    My Bike - Concours 14

    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.
    • Proposed as answer by DevBiker Tuesday, November 29, 2011 1:08 PM
    • Marked as answer by Lily_WuModerator Thursday, December 8, 2011 6:53 AM
    Tuesday, November 29, 2011 1:08 PM
  • It seems my question was not clear... sorry abt tht

    I want to have all three dlls exist in same folder. After building the solutions, I want to run test cases from FirstTest and SecondTest only. Default Search criteria in build definition is "**\*test*.dll".

    For workaround I have changed the name of dlls so that search criteria can seach only those dlls

    example -

    Dlls have been renamed to FirstTests.dll, SecondTests.dll, ThirdTest.dll (extra s in Tests)

    Search criteria changed to "**\*tests.dll" (extra s instead of *)

    Tuesday, November 29, 2011 2:26 PM
  • No ... it was clear. I understood exactly what you were asking. Both of the methods that I suggested - as well as the method that you mentioned - will work to get the result that you want. Your suggestion is a variation on my suggestion #1.

    I, personally, always have separate configurations for the build server vs. desktop and use that to build certain projects vs. others that aren't a part of the build (i.e. scratch or POC projects). When I was build master (not so long ago) at a "large oil & gas company" here in Houston, I also insisted that the development teams did the same thing. If you don't build the project, you won't get the dll. No dll ... no test.

     


    DevBiker (aka J Sawyer)
    My Blog
    My Bike - Concours 14

    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.
    Tuesday, November 29, 2011 3:30 PM

All replies

  • Two ways to do this come to mind.

    First, you can, of course, modify the process template to simply exclude ThirdTest.dll. This will require some hard-coding of the test DLL's that are used in your project. When you open the process template in Visual Studio, you'll see, closer to the bottom, the process for doing the tests. That's where you'll make the changes.

    Second - and I think this is easier and more flexible - you can create a solution configuration for build that simply excludes (doesn't build) the ThirdTest.dll. You then specify these solution configurations for the build, rather than the default of "Debug" or "Release". This can be done in the build definition so it doesn't require any editing of the process template.


    DevBiker (aka J Sawyer)
    My Blog
    My Bike - Concours 14

    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.
    • Proposed as answer by DevBiker Tuesday, November 29, 2011 1:08 PM
    • Marked as answer by Lily_WuModerator Thursday, December 8, 2011 6:53 AM
    Tuesday, November 29, 2011 1:08 PM
  • It seems my question was not clear... sorry abt tht

    I want to have all three dlls exist in same folder. After building the solutions, I want to run test cases from FirstTest and SecondTest only. Default Search criteria in build definition is "**\*test*.dll".

    For workaround I have changed the name of dlls so that search criteria can seach only those dlls

    example -

    Dlls have been renamed to FirstTests.dll, SecondTests.dll, ThirdTest.dll (extra s in Tests)

    Search criteria changed to "**\*tests.dll" (extra s instead of *)

    Tuesday, November 29, 2011 2:26 PM
  • No ... it was clear. I understood exactly what you were asking. Both of the methods that I suggested - as well as the method that you mentioned - will work to get the result that you want. Your suggestion is a variation on my suggestion #1.

    I, personally, always have separate configurations for the build server vs. desktop and use that to build certain projects vs. others that aren't a part of the build (i.e. scratch or POC projects). When I was build master (not so long ago) at a "large oil & gas company" here in Houston, I also insisted that the development teams did the same thing. If you don't build the project, you won't get the dll. No dll ... no test.

     


    DevBiker (aka J Sawyer)
    My Blog
    My Bike - Concours 14

    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.
    Tuesday, November 29, 2011 3:30 PM
  • Hi Akshay,

    Welcome to MSDN forum.
     
    How about the issue now?

    We have noticed that you and Dev both provide proposals in order to resolve the issue, make a try of them may find the workaround. And, i hope you can share the solution & experience here, it will be very beneficial for other community members having the similar questions. 

    Dev, thanks for you work and time.
     
    Best Regards,


    Lily Wu [MSFT]
    MSDN Community Support | Feedback to us
    Thursday, December 1, 2011 3:23 AM
    Moderator
  • Thanks Dev and Lily, Issue is resolved now. Earlier I was separating the DLLs from naming mechanism, now instead of DLLs I am specifying test metadata file to run limited test cases.

    -Akshay

    Friday, December 16, 2011 6:02 AM