sql-serverssistsqltdtexec

Unit testing of SSIS Package with tSQLt


I really like tsqlt to test procs and functions, but really would like to be able to also execute SSIS packages and take advantage of FakeTable and AssertEquals to determine if it was the SSIS package did what it was supposed to.

Has anyone explored this path, is it possible to call dtexec from with the transaction that tsqlt wraps your test in?


Solution

  • I believe I can answer your question Andrey, although this is a little late in coming. But I believe that it will benefit others.

    We are using RedGate SQLTest(tSQLt) to do data quality testing as a part of our integration testing.

    For example to test the completeness of the data being loaded into Staging, on test would be to AssertEqualsTable after a package loads a staging table. Here is the basic order of things:

    Assemble

    Act

    Assert - Select into the actual table from the SSIS destination table of the package being tested.

    And that's all there is too it.

    Take a look at the foreign key tests in the examples database to guide you on foreign key and referential integrity tests.

    I've found it to be invaluable as a means of regression testing our data warehouse load functionality and also validating our orchestration. Because if we can verify that the data is flowing into the right place, at the right time, then things are executing as expected.