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?

SteveC
  • 15,808
  • 23
  • 102
  • 173
lstanczyk
  • 1,313
  • 13
  • 20

2 Answers2

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.

George Mastros
  • 24,112
  • 4
  • 51
  • 59
  • 1
    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! – lstanczyk Mar 28 '12 at 15:19
  • 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. – George Mastros Mar 28 '12 at 15:35
  • 5
    Here is a link to 48 SQLCop tests. http://dl.dropbox.com/u/58229865/SQLCop%20Tests.zip – George Mastros Mar 28 '12 at 15:51
  • 1
    Another approach is to run tSQLt tests as part of your CI process. Dave Green's article describes how to configure this: http://www.simple-talk.com/sql/sql-tools/using-sql-test-database-unit-testing-with-teamcity-continuous-integration/ – David Atkinson Mar 29 '12 at 06:11
  • @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 flags – John Zabroski Jun 10 '14 at 16:52
  • @GMastros Thanks a lot. Could you tell is this the latest version of tests? – gotqn Aug 15 '14 at 08:22
  • Yes. That is the latest version of tests. – George Mastros Oct 30 '15 at 15:58
  • @GMastros The dropbox link is dead now, do you have a new one? – Tom Robinson Feb 26 '18 at 15:32
  • 1
    Ignore me, just found this: https://www.dropbox.com/sh/87t6m3ed5tbh27b/AADW6-gu6jL3E6_dwTyCI5poa?dl=0 – Tom Robinson Feb 26 '18 at 15:34
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.

DaveGreen
  • 712
  • 6
  • 13