Strange issue with SQL Test on the build server

Ron_VerheesRon_Verhees Posts: 5 New member
Hi,

We're seeing a strange issue with Redgate SQL Test in combination with our build server (TFS) and the Redgate SQL Change control components.

In SQL Test we have a bunch of test cases added to all of our databases. We store all of these tests in 1 database and use SQL compare whenever a new test case is added to deploy all test cases to all of our databases to keep the test cases in sync. This works perfectly.

Because not all databases have to pass all of the tests, we added a control table to each database where we can list all of the tests we do not want to test. All test cases have been updated to look at this control table and if it finds the test name, it will just pass the test without any further checks, if it doesn't find it, it'll run the test case. The control table is linked as static data to source control so it's available on the build server too.

This all works fine on the developers local machines, but when checking-in the code and running the test using the redgate TFS component all the tests execute as normal so the tests fail.

Any idea why this is happening? It's almost like it's not querying the control table for some reason?

Thanks,
Ron 
Tagged:

Best Answer

  • Ron_VerheesRon_Verhees Posts: 5 New member
    thanks for the reply Sergio, we actually figured out the issue since... we had the box ticked where it was generating test data in all tables and this actually overwrites any static data (in our case in our test control table). Once we unticked this all was working as expected.

Answers

  • Sergio RSergio R Posts: 610 Rose Gold 5
    Are you using a SQL Source Control or SQL Change Automation project for your database code?
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
  • Ron_VerheesRon_Verhees Posts: 5 New member
    Hi Sergio, SQL Source control to check into TFS.
  • Sergio RSergio R Posts: 610 Rose Gold 5
    I assume that you are using the SQL Change Automation addon, if that's the case this should work if you set a Temporary Database for your build (i.e. do not use local DB and fill in the Temporary Database field). set the Test task Operation to "Run TSQLt in an existing Database" and set the database on the Test Task to be the Temporary database you've set in the Build task.



    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
Sign In or Register to comment.