If you write code to SQL Server then you might be interested in this: at the end of 2017 I wrote a tSQLt tdd training course which has helped over 300 people learn both tSQLt and how to apply TDD practices to their SQL Server T-SQL development, you can join the course at https://courses.agilesql.club. The course is free if you are happy to wait 10 weeks to complete it, with 1 lesson being made available per week - if you are in more of a hurry or you would like to help support the project you can purchase the course which makes it instantly available to you.
I have released a new version of SQLCover which is a code coverage tool for T-SQL (let’s you identify where you need to focus when writing tests).
This includes a few minor fixes but also support for SQL Azure so if you run your test in a v12 database or higher you can now get an idea of code coverage from that.
If you are interested in using this but don’t know where to start, there is a powershell script in the download (https://the.agilesql.club/SQLCover/download.php) and if you also get reportgenerator (https://github.com/danielpalme/ReportGenerator/releases/tag/v220.127.116.11):
Once you have downloaded SQLCover, extract the files and right click “SQLCover.dll” go to properties and click “Unblock”
Then in powershell run:
$result = Get-CoverTSql "path\to\SQLCover.dll" "connection string" "database name" "query"
$outputFolder = "C:\some\path"
Export-OpenXml $result "$outputFolder"
Start-ReportGenerator "$outputFolder" "c:\path\to\ReportGenerator.exe"
Change the path to SQLCover, the connection string, database name, query (tSQLt.RunAll), output path and path to report generator (phew) then run it and it should create an “out” directory under the output folder - open index.html and see the awesomeness of the reportgenerator output:
If you want to run mstest tests or nunit or something else completely then have a look in the SQLCover.ps1 which includes some examples at the bottom but Get-CoverExe is probably your friend.
Any questions please shout!
September 1, 2016 - 00:07
I was looking at sqlCover.dll code and found that you have defaulted command timeout to 30 sec which is very less to run all test classes for large databases. Are you planning to change it in future version?