Comments
4 comments
-
Yes, this is possible as tSQLt can output an Ant JUnit XML Report, which can be consumed by CI tools. Rather than describe it here, I'll direct you to Dave Green's excellent article:
http://www.simple-talk.com/sql/sql-tool ... tegration/
Although the example uses TeamCity, this applies to all CI tools.
Let us know how you get on.
David Atkinson
Red Gate -
In case anyone else was wondering, I found the solution to the build failure problem. You can cause sqlcmd.exe to fail if you use the -b option
<Target Name="Test"> <Message Text="==================================================" /> <Message Text="== Run tSQLt Tests" /> <Message Text="==" /> <Exec Command=""$(SqlCmdPath)" -Q "EXEC tSQLt.RunAll" -S localhost -d MyDb -b -E" /> <Message Text="==================================================" /> </Target>
-
Glad you got that working.
Did you get the integration with your CI tool working using TestResults.xml?
David -
David Atkinson wrote:Yes, this is possible as tSQLt can output an Ant JUnit XML Report, which can be consumed by CI tools. Rather than describe it here, I'll direct you to Dave Green's excellent article:
http://www.simple-talk.com/sql/sql-tool ... tegration/
Thanks, David. I've amended my scripts.
Add comment
Please sign in to leave a comment.
Is there a way to get the sqlcmd command to fail when the tests fail?
Another question:
Can the tests produce an XML file that can be parsed and used for reporting on a CI server such as Jenkins or TeamCity?