SQLCop tests for tSQLt
Asked Answered
M

2

13

The Redgate tool SQLTest for SQL unit testing now offers the ability to add tests from SQLCop however the Redgate tool only comes with few of those tests prebuild.

Since tests are just stored procedures I am sure somebody has implemented more of those tests.

Are you willing to share? Anyone?

Mapp answered 27/3, 2012 at 22:52 Comment(0)
F
23

I wrote SQLCop. I've been working with the fine folks over at Redgate. Originally I provided 5 (or so) tests as a proof of concept. Since then, I have also provided the remaining tests that are included with SQLCop. You should expect the remaining tests to be included in their next release of SQL Test.

Faubert answered 28/3, 2012 at 12:42 Comment(9)
Since they are all just stored procedures and could live separately form the red-gate tool - would you be willing to share them before red gate? The issue is that as much as i like red gate tool i am looking more into implementing tests as a part of my continuous integration rather than running them from management studio via SQLtest. By the way - great work on the SQL Cop - I love it!Mapp
Did you know that you can run SQLCop in a command line mode? At a command prompt, type "SQLCop -?". This will show you the command line arguments available. I modeled the command line arguments after SQLCMD. Anyway... you could create a batch file with the appropriate command line arguments that sends the output to a file, and then use windows task scheduler to execute the task on a schedule.Faubert
Here is a link to 48 SQLCop tests. dl.dropbox.com/u/58229865/SQLCop%20Tests.zipFaubert
Another approach is to run tSQLt tests as part of your CI process. Dave Green's article describes how to configure this: simple-talk.com/sql/sql-tools/…Timbal
@GMastros It seems as though the most recent version of SQLCop does not support command prompt usage. I typed in "SQLCop -?" in PowerShell and it opens the GUI. I also tried --?, --help, -h, -help, /help, and --h as flagsMockery
@GMastros Thanks a lot. Could you tell is this the latest version of tests?Outofdoors
Yes. That is the latest version of tests.Faubert
@GMastros The dropbox link is dead now, do you have a new one?Brittaney
Ignore me, just found this: dropbox.com/sh/87t6m3ed5tbh27b/AADW6-gu6jL3E6_dwTyCI5poa?dl=0Brittaney
T
1

I've had SQLCop-type tests on my list of things I should get round to implementing, but have thus far only really implemented some 'test coverage' tests, which are pretty specific to our naming conventions here.

I do note that SQL Test is a preview product from Red Gate, so hopefully there will be more tests in the full release. From reading http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/sqlcop-integration-with-red-gate (and a couple of comments on the below forum link) it looks promising. EDIT: George's comment above confirms this.

You could consider logging the request at the forum that Red Gate link to from their website for feedback - http://sqltest.uservoice.com/forums/140716-sql-test-forum

If I do get some more generic tests written soon for my own purposes, I'll certainly share them.

Tyson answered 28/3, 2012 at 12:53 Comment(1)
If you have written tests that you would like included with SQLCop, let me know and I will consider including them.Faubert

© 2022 - 2025 — McMap. All rights reserved.