VS 2017 Run All Tests Doesn't Find TSQLT Test

I've gone through the steps described on this page: https://documentation.red-gate.com/sca3/tutorials/worked-examples/use-tsqlt-with-sql-change-automation-projects 

When I choose Test->Run->All Tests, VS says it can't find any tests.  (I have one inline function (test) named: tsqlt.test_usp_blahblah, which works fine under SSMS using EXEC tSQLt.RunAll;)

Here is what seems to be the relevant text from the output:
"
[8/7/2019 5:27:50 PM Warning] No test is available in C:.....
"
and
"
Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
[8/7/2019 5:28:39 PM Informational] ========== Discover test finished: 0 found (0:00:02.7341039) ==========
[8/7/2019 5:28:39 PM Informational] ------ Run test started ------
[8/7/2019 5:28:41 PM Informational] tSQLt Test Adapter, adding filter...- Tests
[8/7/2019 5:28:42 PM Error] An exception occurred while invoking executor 'executor://tsqlttestexecutor/v1': Object reference not set to an instance of an object.
[8/7/2019 5:28:43 PM Informational] ========== Run test finished: 0 run (0:00:03.6254196) ==========
"

Thanks in advance for any help!

Steve
Tagged:

Answers

  • Eddie DEddie D Posts: 1,807 Rose Gold 5
    Hi Steve

    Thank you for your forum post.

    I assume that you downloaded and installed the tSQLTt Visual Studio Test Adapter.  Followed by creating the <databasename>.runsettings file.

    Does the value of the TestDatabaseConnectionString match Properties > Debug > Target Connection String in the <databasename>.Database?

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • FarmboyEsqFarmboyEsq Posts: 4 Bronze 1
    Thanks for the reply.  I did install the tSQLt VS Test Adapter, and the runsettings connection did match (up through the Integrated Security parameter).  But, I added the rest just to make them match 100%

    ";Persist Security Info=False;Pooling=False;MultipleActiveResultSets=False;Connect Timeout=10;Encrypt=False;TrustServerCertificate=True"

    I did notice however that my runsettings was named as <solution>.runsettings (in the solution folder.)   I saved a copy as <database>.runsettings.   
    Restarted Visual Studio. 
    Ran all tests.  
    Same messages as before.

    Rechecked the documentation;
    Selected the <database>.runsettings file in "Test->Test Settings->Select Test Settings File"
    Restarted Visual Studio.  
    Ran all tests. 
    Same messages as before.
  • Eddie DEddie D Posts: 1,807 Rose Gold 5
    Hi,
    I found some useful advice in this Internet Article, hopefully it will contain useful information to get up and running.

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.