none
SSDT Unit testing across multiple environments

Answers

All replies

  • Just to follow up on this, ive been working with a guy who knows a lot more than myself about MSTEST, so we now have MSTTEST running using an alternative testsettings file which specifies a different server than the default.

    However MSTEST states that it is loading the alternative file but it still uses the orignal app.config settings.

    I have proved this by using a test of 'select @@servername' which still passes against the different settings and with profiler i can see the calls coming to the original machine

    Dave


    Dave Ballantyne ---- http://sqlblogcasts.com/blogs/sqlandthelike/

    Friday, January 04, 2013 4:30 PM
  • The xml element should look like <SqlUnitTesting> . If you could share your app.config, testsettings and mstest cmd line details, we could help debug better.

    Thanks,

    Saloni

    Saturday, January 05, 2013 1:56 AM
  • Hi Saloni,

    Its easy to re-create that,  all im doing is

    Test -> New Test -> Create a new c# project  , and the default app.config will state SqlUnitTesting_VS2010

    Dave


    Dave Ballantyne ---- http://sqlblogcasts.com/blogs/sqlandthelike/

    Saturday, January 05, 2013 11:49 AM
  • Hi

    OK,  i have now got this working,

    JT's blog is still valid on this subject.

    I will point out though that the override file HAS to be called <MachineName>.sqlunittest.config or <UserName>.sqlunittest.config.

    It is also very sensitive,  i had some leading whitespace in the file which caused a "cannot find element" error to occur.

    Is there no way to specify which .sqlunitest.config should be used, having just the mentioned naming convention does seem very limiting for the long term

    Dave


    Dave Ballantyne ---- http://sqlblogcasts.com/blogs/sqlandthelike/

    Monday, January 07, 2013 12:41 PM
  • Hi

    OK,  i have now got this working,

    JT's blog is still valid on this subject.

    Thanks mate :)

    I will point out though that the override file HAS to be called <MachineName>.sqlunittest.config or <UserName>.sqlunittest.config.

    It is also very sensitive,  i had some leading whitespace in the file which caused a "cannot find element" error to occur.

    Is there no way to specify which .sqlunitest.config should be used, having just the mentioned naming convention does seem very limiting for the long term

    Yes, its VERY limiting. I get around this by having different .testsettings files. these can have whatever name you like and each one chooses which .sqlunittest.config file gets bundled along for the ride. There's no way you'll ever get it right first time so its a case of trial and error.

    Its ridiculous that it is this hard, but heigh ho!


    ObjectStorageHelper<T> – A WinRT utility for Windows 8 | http://sqlblog.com/blogs/jamie_thomson/ | @jamiet | About me
    Jamie Thomson

    Monday, January 07, 2013 1:52 PM
  • That's great that you were able to figure it out, thanks to JT's blog :-) And yes, I'd use .testsettings, which gives you a little more flexibility.

    Thanks for the update!

    Saloni

    Monday, January 07, 2013 6:38 PM
  • For reference ive put a blog together on this subject with one or two other options

    http://sqlblogcasts.com/blogs/sqlandthelike/archive/2013/01/07/ssdt-tsql-unit-testing-in-multiple-environments.aspx


    Dave Ballantyne ---- http://sqlblogcasts.com/blogs/sqlandthelike/

    Tuesday, January 08, 2013 10:39 AM