Hi,
Is there an action which will run all tests in a VS.NET (2010) solution? Basically I'm looking for the FinalBuilder equivelant to the "Run All Tests In Solution (Ctrl+R, A)" button in Visual Studio. I can't seem to find it.
Thank you,
-James
Hi,
Is there an action which will run all tests in a VS.NET (2010) solution? Basically I'm looking for the FinalBuilder equivelant to the "Run All Tests In Solution (Ctrl+R, A)" button in Visual Studio. I can't seem to find it.
Thank you,
-James
Hi James
The Run MSTest action allows you pass in a Test Metadata File (vsmdi file) to specify the tests to be run. All you need to do is open Visual Studio, open the vsmdi file included in your solution and create your test lists. Once you have assigned tests to your test lists then you can use the Run MSTest action to execute these tests.
Also, the Run MSTest action allows you to selectively run tests based on test name or test list name.
Regards,
Steve
The problem I have with this is that we need to maintain the list; its extra work that no one on the team is used to doing.
I ended up using a File Iterator to recursivly look for all *.Tests.dll files. Nested under that action is an If .. Then action that ensures "\bin\" is in the current file path (this excludes obj and other directories). I tried to make the MSTest action conditional using the "Execute Condition" property, but I couldn't seem to figure out an expression that didn't cause an error (e.g. "%CurrentAssemblyPath%".indexOf("\bin\") >= 0). Finally, nested under the If .. Then action is a Run MSTest action that simply passes the current DLL in.
It's a bit more verbose than I would like, but it works and does not require us to maintain a redundant list of tests. It would be nice to make the MSTest action conditional, but I can live with what I've got .
Hi James
As far as only filtering out directories that don’t contain ‘\bin’ in the path, there are a few ways you could do this:
1) Rather than using the File Iterator by itself, first define a File Set. Set the include pattern to ‘*.Tests.dll’ and then add a ‘Path Contains’ filter to only include files that contain ‘\bin’. You can now use the File Iterator to iterate the contents of the file set.
2) If you you would rather make the MSTest action conditional (using a complex condition), you can use the BeforeAction script event evaluate your condition. If you want to skip the execution of the action, set the SkipAction property to true.
3) To use the Execute Condition as you mentioned above, remove the percentage signs from the variable reference and escape the backslashes (e.g. CurrentAssemblyPath.indexOf("\bin\") > -1 ) and this will work.
Hope this helps.
Regards,
Steve
In addition to what Steve mentioned, we should point out that for the condition statement, you do not need to use %variable% for variables, it’s a boolean expression in script, and finalbuilder variables can be referenced directly, e.g :
[code]CurrentAssemblyPath.indexOf("\bin") >= 0[/code]
or (better, to avoid scope issues)
[code]FBVariables.CurrentAssemblyPath.indexOf("\bin") >= 0[/code]
Ah, the missing ingredients! Thank you Stephen & Vincent!