Skip to content

Commit

Permalink
fix test (do Get-DbaEstimatedCompletionTime)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasjordan committed Oct 19, 2024
1 parent 50b1d2b commit 29d9d2c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/Get-DbaEstimatedCompletionTime.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,21 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
BeforeAll {
$server = Connect-DbaInstance -SqlInstance $script:instance2
$null = Get-DbaDatabase -SqlInstance $server -Database checkdbTestDatabase | Remove-DbaDatabase -Confirm:$false
$null = Restore-DbaDatabase -SqlInstance $server -Path $script:appveyorlabrepo\sql2008-backups\db1\SQL2008_db1_FULL_20170518_041738.bak -DatabaseName checkdbTestDatabase
$null = Restore-DbaDatabase -SqlInstance $server -Path $script:appveyorlabrepo\sql2008-backups\db1\FULL\SQL2008_db1_FULL_20170518_041738.bak -DatabaseName checkdbTestDatabase
$null = New-DbaAgentJob -SqlInstance $server -Job checkdbTestJob
$null = New-DbaAgentJobStep -SqlInstance $server -Job checkdbTestJob -StepName checkdb -Subsystem TransactSql -Command "DBCC CHECKDB('checkdbTestDatabase')"
}

AfterAll {
$server = Connect-DbaInstance -SqlInstance $script:instance2
$null = Remove-DbaAgentJob -SqlInstance $server -Job checkdbTestJob -Confirm:$false
$null = Get-DbaDatabase -SqlInstance $erver -Database checkdbTestDatabase | Remove-DbaDatabase -Confirm:$false
$null = Get-DbaDatabase -SqlInstance $server -Database checkdbTestDatabase | Remove-DbaDatabase -Confirm:$false
}

Context "Gets Query Estimated Completion" {
$server = Connect-DbaInstance -SqlInstance $script:instance2
$null = Start-DbaAgentJob -SqlInstance $server -Job checkdbTestJob
$results = Get-DbaEstimatedCompletionTime -SqlInstance $server
$null = Remove-DbaAgentJob -SqlInstance $server -Job checkdb -Confirm:$false
Start-Sleep -Seconds 5
It "Gets results" {
$results | Should Not Be $null
Expand Down

0 comments on commit 29d9d2c

Please sign in to comment.