Search code examples
visual-studio-2015azure-devopstsqltreadyroll

How to Integrating tSQLt tests with Visual Studio Team Services?


I had developed simple Ready Roll database project by following this Getting started with ReadyRoll.

After that I added the tSQLt tests in VS2015 using tSQLt adapter by following this Running tests in ReadyRoll with tSQLt Adapter.

Next check in my code into VSTS and created the build and release steps by following this links.

create-vsts-tfs-build

create-vsts-tfs-release

tsqlt-tests-with-visual-studio-team-services

Run tSQLt tests task configuration at release level enter image description here

I am little bit confusion which path to give under Test results output path in in Run tSQLt tests task configuration at release level.

So, I am getting the error at release level in Run tSQLt tests task like shown in below figure.

enter image description here

Can anyone please tell me how to resolve the above issue?


Solution

  • This issue is now fixed in the version 2.1.4 of VSTS ReadyRoll extension.

    The problematic lines:

    Invoke-VstsTool -FileName 'sqlcmd.exe' -Arguments "-S $databaseServer -d $databaseName -i 'RunTests.sql'"
    Invoke-VstsTool -FileName 'sqlcmd.exe' -Arguments "-S $databaseServer -d $databaseName -i 'OutputResults.sql' -o $outputPath"
    

    were replaced by:

    $connectionParams = "-S ""$databaseServer"" -d ""$databaseName"""
    Invoke-VstsTool -RequireExitCodeZero -FileName 'sqlcmd.exe' -Arguments "-b $connectionParams -i RunTests.sql"
    Invoke-VstsTool -RequireExitCodeZero -FileName 'sqlcmd.exe' -Arguments "-b $connectionParams -i OutputResults.sql -o ""$outputPath"""
    

    Apologies for any inconvenience caused.