SQL Test not showing all results in TestResult

BrainDonorBrainDonor Posts: 55 Silver 2
edited January 19, 2016 6:16AM in SQL Test
Playing with SQL Test against the AdventureWorks2012 database, and when executing all of the SQLCop tests, I don't appear to be getting all of the results written to the tSQLt.TestResult table - only the last test of the queue.


The screen-shot above shows that there are 12 failures, but the query against TestResult only shows 1 result.


Interestingly, the 'Id' column increments by 49 each time, which is the number of tests within that list.
Additionally, if I run the query against TestResult whilst the tests are executing (with NOLOCK) I can see other entries being added while running, but it only ever seems to show one row.

If I run any of these tests individually then the results from that one test are always available within the TestResult table.

So it appears that every row written to the TestResult table is removed as the next row from that test suite is written to it.

Has anybody else encountered this, or know what it may be that I'm doing that would cause this?


  • Options

    SQL Test runs each test individually, so tSQLt.TestResult will only ever hold a single row for the most recent test. If you'd like to suggest that we change this behaviour then I'd recommend that you add the suggestion to our UserVoice site.

    Software Engineer
    Redgate Software
  • Options
    Hi Robert,

    Thanks for your time. I will make the suggestion, once I can get my head around that UserVoice site - it isn't pretty!

    It doesn't make sense to myself, to only get the result back from the last test, when an entire test class has been executed.


Sign In or Register to comment.