Search code examples
visual-studiounit-testingtfstfsbuildvstest

Run multiple test same build from different tests project


Need your help in the following scenario:

  • I have a solution with 2 projects with different unit tests
  • Those projects generate 2 different dll: *deployment.dll and *database.dll
  • I have a build on TFS that I want to use to run those tests, I'm using "Test Case Filter" to filter the categories of my tests

    (TestCategory=TEST1|TestCategory=TEST2|TestCategory=TEST3|TestCategory=TEST4) 
    

    and in "Test Sources Spec" I'm filtering both dll (*deployment.dll;*database.dll)

  • *.deployment.dll has TEST2, TEST3, TEST4
  • *.database.dll has TEST1

This doesn't work, tests of *database.dll does not run. Test selected in Visual Studio Test Runner

Could you please help on that? If I make the build with only 1 dll, for example, *.database.dll, TEST1 runs well.

(UPDATE) SCENARIO 1

Test Case Filter: TestCategory=TEST1|TestCategory=TEST1|TestCategory=TEST2|TestCategory=TEST3|TestCategory=TEST4

Test Sources Spec: *database.dll;*deployment.dll

only runs TEST1


(UPDATE) SCENARIO 2

Test Case Filter: TestCategory=TEST1|TestCategory=TEST1|TestCategory=TEST2|TestCategory=TEST3|TestCategory=TEST4

Test Sources Spec: **\*deployment.dll;*database.dll

only runs TEST2,TEST3,TEST4

(UPDATE) Does not find tests in Database.dll enter image description here


Solution

  • Finally, it's solved :)

    So, what I have done to solve this problem, was, change Build Process Template.

    There are one step in this process, calling: "FindMatchingFiles"

    I change this value as the below image shows. (however, from now on, I must use "**\*" in all my filters that use this process template). This operation make sure that I have the assemblies with fullpath destination complete.

    If you have different solutions, please post here :)

    Special thank you to @Cece - MSFT for all support

    enter image description here