diff --git a/tests/run-tests.ps1 b/tests/run-tests.ps1 deleted file mode 100644 index c16ea15f5..000000000 --- a/tests/run-tests.ps1 +++ /dev/null @@ -1,14 +0,0 @@ -# Assign default values if script-scoped variables are not set -$ServerInstance = if ($null -ne $script:ServerInstance) { $script:ServerInstance } else { "localhost" } -$UserName = if ($null -ne $script:UserName) { $script:UserName } else { "sa" } -$Password = if ($null -ne $script:Password) { $script:Password } else { "dbatools.I0" } -$TrustServerCertificate = if ($null -ne $script:TrustServerCertificate) { $script:TrustServerCertificate } else { $true } - -$PSDefaultParameterValues = @{ - "*:ServerInstance" = $ServerInstance - "*:UserName" = $UserName - "*:Password" = $Password - "*:TrustServerCertificate" = $TrustServerCertificate -} - -Invoke-Pester -PassThru \ No newline at end of file diff --git a/tests/sp_Blitz.tests.ps1 b/tests/sp_Blitz.tests.ps1 deleted file mode 100644 index 341b9c348..000000000 --- a/tests/sp_Blitz.tests.ps1 +++ /dev/null @@ -1,10 +0,0 @@ -Describe "sp_Blitz Tests" { - - It "sp_Blitz Check" { - $results = Invoke-SqlCmd -Query "EXEC dbo.sp_Blitz" -OutputAs DataSet - $results.Tables.Count | Should -Be 1 - $results.Tables[0].Columns.Count | Should -Be 9 - $results.Tables[0].Rows.Count | Should -BeGreaterThan 0 - } - -} diff --git a/tests/sp_BlitzAnalysis.tests.ps1 b/tests/sp_BlitzAnalysis.tests.ps1 deleted file mode 100644 index f346b6197..000000000 --- a/tests/sp_BlitzAnalysis.tests.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -Describe "sp_BlitzAnalysis Tests" { - - It "sp_BlitzAnalysis Check" { - - # Run sp_BlitzFirst to populate the tables used by sp_BlitzAnalysis - Invoke-SqlCmd -Query "EXEC dbo.sp_BlitzFirst @OutputDatabaseName = 'tempdb', @OutputSchemaName = N'dbo', @OutputTableName = N'BlitzFirst', @OutputTableNameFileStats = N'BlitzFirst_FileStats',@OutputTableNamePerfmonStats = N'BlitzFirst_PerfmonStats', - @OutputTableNameWaitStats = N'BlitzFirst_WaitStats', - @OutputTableNameBlitzCache = N'BlitzCache', - @OutputTableNameBlitzWho= N'BlitzWho'" - - $results = Invoke-SqlCmd -Query "EXEC dbo.sp_BlitzAnalysis @OutputDatabaseName = 'tempdb'" -OutputAs DataSet - $results.Tables.Count | Should -BeGreaterThan 6 - } - -} diff --git a/tests/sp_BlitzBackups.tests.ps1 b/tests/sp_BlitzBackups.tests.ps1 deleted file mode 100644 index 162e869fb..000000000 --- a/tests/sp_BlitzBackups.tests.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -Describe "sp_BlitzBackups Tests" { - - It "sp_BlitzBackups Check" { - # Give sp_BlitzBackups something to capture by performing a dummy backup of model DB - # Test to be run in GitHub action but backing up model to NUL should be safe on most systems - Invoke-SqlCmd -Query "BACKUP DATABASE model TO DISK='NUL'" - $results = Invoke-SqlCmd -Query "EXEC dbo.sp_BlitzBackups" -OutputAs DataSet - $results.Tables.Count | Should -Be 3 - - $results.Tables[0].Columns.Count | Should -Be 39 - $results.Tables[0].Rows.Count | Should -BeGreaterThan 0 - - $results.Tables[1].Columns.Count | Should -Be 32 - $results.Tables[1].Rows.Count | Should -BeGreaterThan 0 - - $results.Tables[2].Columns.Count | Should -Be 5 - $results.Tables[2].Rows.Count | Should -BeGreaterThan 0 - } - -} diff --git a/tests/sp_BlitzCache.tests.ps1 b/tests/sp_BlitzCache.tests.ps1 deleted file mode 100644 index 4483e090b..000000000 --- a/tests/sp_BlitzCache.tests.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -Describe "sp_BlitzCache Tests" { - - It "sp_BlitzCache Check" { - # Note: Added 'SELECT 1 AS A' as an empty first resultset causes issues returning the full DataSet - $results = Invoke-SqlCmd -Query "SELECT 1 AS A;EXEC dbo.sp_BlitzCache" -OutputAs DataSet - # Adjust table count to get the actual tables returned from sp_BlitzCache (So reporting isn't confusing) - $tableCount = $results.Tables.Count -1 - $tableCount | Should -Be 2 - $results.Tables[1].Columns.Count | Should -Be 43 - $results.Tables[2].Columns.Count | Should -Be 6 - $results.Tables[2].Rows.Count | Should -BeGreaterThan 0 - } -} \ No newline at end of file diff --git a/tests/sp_BlitzFirst.tests.ps1 b/tests/sp_BlitzFirst.tests.ps1 deleted file mode 100644 index d2bb42d3f..000000000 --- a/tests/sp_BlitzFirst.tests.ps1 +++ /dev/null @@ -1,40 +0,0 @@ -Describe "sp_BlitzFirst Tests" { - - It "sp_BlitzFirst Check" { - # Give sp_BlitzFirst something to capture - Start-Job -ScriptBlock { - Invoke-SqlCmd -Query "WAITFOR DELAY '00:00:15'" -ServerInstance $using:ServerInstance -Username $using:UserName -Password $using:Password -TrustServerCertificate:$using:TrustServerCertificate - } - Start-Sleep -Milliseconds 1000 - $results = Invoke-SqlCmd -Query "EXEC dbo.sp_BlitzFirst" -OutputAs DataSet - $results.Tables.Count | Should -Be 1 - $results.Tables[0].Columns.Count | Should -Be 8 - $results.Tables[0].Rows.Count | Should -BeGreaterThan 0 - - $results = Invoke-SqlCmd -Query "EXEC dbo.sp_BlitzFirst @ExpertMode=1" -OutputAs DataSet - $results.Tables.Count | Should -Be 7 - - $results.Tables[0].Columns.Count | Should -Be 21 - $results.Tables[0].Rows.Count | Should -BeGreaterThan 0 - - $results.Tables[1].Columns.Count | Should -Be 40 - $results.Tables[1].Rows.Count | Should -BeGreaterThan 0 - - $results.Tables[2].Columns.Count | Should -Be 13 - $results.Tables[2].Rows.Count | Should -BeGreaterThan 0 - - $results.Tables[3].Columns.Count | Should -Be 11 - $results.Tables[3].Rows.Count | Should -BeGreaterThan 0 - - $results.Tables[4].Columns.Count | Should -Be 10 - $results.Tables[4].Rows.Count | Should -BeGreaterThan 0 - - $results.Tables[5].Columns.Count | Should -Be 4 - $results.Tables[5].Rows.Count | Should -BeGreaterThan 0 - - $results.Tables[6].Columns.Count | Should -Be 21 - $results.Tables[6].Rows.Count | Should -BeGreaterThan 0 - - } - -} \ No newline at end of file diff --git a/tests/sp_BlitzIndex.tests.ps1 b/tests/sp_BlitzIndex.tests.ps1 deleted file mode 100644 index 63c479ad3..000000000 --- a/tests/sp_BlitzIndex.tests.ps1 +++ /dev/null @@ -1,10 +0,0 @@ -Describe "sp_BlitzIndex Tests" { - - It "sp_BlitzIndex Check" { - $results = Invoke-SqlCmd -Query "EXEC dbo.sp_BlitzIndex" -OutputAs DataSet - $results.Tables.Count | Should -Be 1 - $results.Tables[0].Columns.Count | Should -Be 12 - $results.Tables[0].Rows.Count | Should -BeGreaterThan 0 - } - -} \ No newline at end of file diff --git a/tests/sp_BlitzLock.tests.ps1 b/tests/sp_BlitzLock.tests.ps1 deleted file mode 100644 index 5368e3283..000000000 --- a/tests/sp_BlitzLock.tests.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -Describe "sp_BlitzLock Tests" { - - It "sp_BlitzLock Check" { - # Note: Added 'SELECT 1 AS A' as an empty first resultset causes issues returning the full DataSet - $results = Invoke-SqlCmd -Query "SELECT 1 AS A;EXEC dbo.sp_BlitzLock" -OutputAs DataSet - # Adjust table count to get the actual tables returned from sp_BlitzLock (So reporting isn't confusing) - $tableCount = $results.Tables.Count - 1 - $tableCount | Should -Be 3 - } - -} \ No newline at end of file diff --git a/tests/sp_BlitzWho.tests.ps1 b/tests/sp_BlitzWho.tests.ps1 deleted file mode 100644 index 3e9febd56..000000000 --- a/tests/sp_BlitzWho.tests.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -Describe "sp_BlitzWho Tests" { - - It "sp_BlitzWho Check" { - # Give sp_BlitzWho something to capture - Start-Job -ScriptBlock { - Invoke-SqlCmd -Query "WAITFOR DELAY '00:00:15'" -ServerInstance $using:ServerInstance -Username $using:UserName -Password $using:Password -TrustServerCertificate:$using:TrustServerCertificate - } - Start-Sleep -Milliseconds 1000 - $results = Invoke-SqlCmd -Query "EXEC dbo.sp_BlitzWho" -OutputAs DataSet - $results.Tables.Count | Should -Be 1 - $results.Tables[0].Columns.Count | Should -Be 21 - $results.Tables[0].Rows.Count | Should -BeGreaterThan 0 - } - -} \ No newline at end of file