Release 0.5 - minor fixes and features
Timeouts
There are two ways you can timeout when running queries, a TDS connection timeout and a query execution timeout. The default connection timeout is 15 seconds and you can override that timeout by changing the connection string you pass in so that it includes "Connect Timeout=XX;".
There is a second type of timeout, that is the query timeout and there are a number of queries that SQLCover runs so if you are getting query timeouts you can pass in a timeout to when you call:
CodeCoverage.Start(int timeout = 30)
CodeCoverage.Cover(string query, int timeout = 30)
These both default to 30 but you can set them to whatever you like. If you are using the powershell wrapper change:
function Get-CoverTSql{
param(
[string]$coverDllPath
,[string]$connectionString
,[string]$databaseName
,[string]$query
)
if(!(Test-Path $coverDllPath)){
Write-Error "SQLCover.dll path was not found ($coverDllPath)"
return
}
Unblock-File -Path $coverDllPath
Add-Type -Path $coverDllPath
$coverage = new-object SQLCover.CodeCoverage ($connectionString, $databaseName)
#$coverage.Cover($query) <----- CHANGE THIS LINE TO
$coverage.Cover($query, 600) #<----- CHANGE THIS LINE TO 600 for 5 minutes (oof!)
}
Corbertura
You can now output the results in corbertura format, this is really exciting as vsts (azure devops) in-built test tasks parse corbertura files:
html output
I have added a html2() output which is more exciting than the original html output.
Up arrow
The coverage report has an up arrow so you can easily navigate back to the top of the page, nice.
Warnings
If there is an exception (including the tSQLt text output - this is much better than it sounds!) then you get a little warning at the top saying "There were sql exceptions running the batch, see here" and then at the bottom of the output you see any error output.
This is really usefull because, in the old version, if there was an exception you would see no output but now you can see that there has been an exception and that should explain missing stats.
Time of run
I have added to html2() the time of the run so you can see it in the report.
bug fixes
https://github.com/Azhkanizkael kindly fixed an issue with triggers causing exceptions