SQL Test not showing all results in TestResult
BrainDonor
Posts: 57 Silver 2
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?
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?
Comments
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.
Thanks!
Redgate Software
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.
Regards,
Steve.