@@ -48,26 +48,26 @@ Describe $CommandName -Tag IntegrationTests {
4848 # Create target DB (empty - no tables, so source will show Create differences).
4949 $null = New-DbaDatabase - SqlInstance $TestConfig.InstanceSingle - Name $dbTargetName
5050
51+ # Define file paths for the DACPACs.
52+ $sourceDacpac = " $testFolder \$dbSourceName .dacpac"
53+ $emptyTargetDacpac = " $testFolder \$dbTargetName .dacpac"
54+
5155 # Export source DB to a DACPAC.
5256 $splatExport = @ {
5357 SqlInstance = $TestConfig.InstanceSingle
5458 Database = $dbSourceName
55- FilePath = " $testFolder \ $dbSourceName .dacpac "
59+ FilePath = $sourceDacpac
5660 }
5761 $null = Export-DbaDacPackage @splatExport
5862
59- $sourceDacpac = " $testFolder \$dbSourceName .dacpac"
60-
6163 # Export the empty target DB to a DACPAC now, before any tests modify it.
6264 $splatExportTarget = @ {
6365 SqlInstance = $TestConfig.InstanceSingle
6466 Database = $dbTargetName
65- FilePath = " $testFolder \ $dbTargetName .dacpac "
67+ FilePath = $emptyTargetDacpac
6668 }
6769 $null = Export-DbaDacPackage @splatExportTarget
6870
69- $emptyTargetDacpac = " $testFolder \$dbTargetName .dacpac"
70-
7171 # We want to run all commands outside of the BeforeAll block without EnableException to be able to test for specific warnings.
7272 $PSDefaultParameterValues.Remove (" *-Dba*:EnableException" )
7373 }
@@ -86,10 +86,10 @@ Describe $CommandName -Tag IntegrationTests {
8686 Context " Compare DACPAC against a live database" {
8787 It " Returns schema differences when source has objects not in target" {
8888 $splatCompare = @ {
89- SourcePath = $sourceDacpac
90- TargetSqlInstance = $TestConfig.InstanceSingle
91- TargetDatabase = $dbTargetName
92- OutputPath = $testFolder
89+ SourcePath = $sourceDacpac
90+ TargetSqlInstance = $TestConfig.InstanceSingle
91+ TargetDatabase = $dbTargetName
92+ OutputPath = $testFolder
9393 }
9494 $result = Compare-DbaDbSchema @splatCompare
9595 $result | Should -Not - BeNullOrEmpty
0 commit comments