Comments
2 comments
-
I don't love it. I'd rather use the PowerShell Commandlets but I ended up using MSBuild to build/deploy the database to the server (can't use in memory since I have a full text index). Then I point Invoke-DatabaseTests directly at the testing database which already has the tests deployed to it.
Exec { msbuild $SOLUTION /NoLogo /v:Minimal /t:Build /p:OutputPath=$outputDir /p:Configuration=Release /p:DeploymentMode=DeployOnBuild /p:ShadowServer=ServerName /p:ShadowUserName=$Uname /p:ShadowPassword=$Pass /p:TargetServer=ServerName /p:TargetDatabase=TestingDatabase /p:TargetUserName=$Uname /p:TargetPassword=$Pass} "Failed to build $_" $testResultsFile = "$env:WORKSPACE\out\tSQLtResults.junit.xml" $testResults = Invoke-DatabaseTests $testingDb Export-DatabaseTestResults $testResults -OutputFile $testResultsFile
-
Hi ssvoss,
Thanks for posting on the Redgate forums.
If you need any specifc help troubleshooting the errors please do post them here or create a support ticket at https://productsupport.red-gate.com/hc/en-us
Add comment
Please sign in to leave a comment.
In my build script I use the PowerShell commandlets to Invoke-DatabaseBuild, New-DatabaseBuildArtifact, and Export-DatabaseBuildArtifact on main.sqlproj
In my test script I'm trying to use Invoke-DatabaseTests on test.sqlproj. However it errors and it is obvious that the main project is not being built and deployed before deploying the test project. (As I might have expected due to setting up a project build dependency)
What is the best practice for this or what have people found that works?
[1] https://documentation.red-gate.com/sca3/tutorials/worked-examples/use-tsqlt-with-sql-change-automation-projects