Skip to content

Commit

Permalink
that test got all kinds of messed up
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 26, 2024
1 parent 720dc05 commit f23f7c6
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/Add-DbaPfDataCollectorCounter.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,23 @@ Describe "Add-DbaPfDataCollectorCounter" -Tag "UnitTests" {

Describe "Add-DbaPfDataCollectorCounter" -Tag "IntegrationTests" {
BeforeAll {
$null = Get-DbaPfDataCollectorSetTemplate -Template 'Long Running Queries' | Import-DbaPfDataCollectorSetTemplate | Get-DbaPfDataCollector | Get-DbaPfDataCollectorCounter -Counter '\LogicalDisk(*)\Avg. Disk Queue Length' | Remove-DbaPfDataCollectorCounter -Confirm:$false
$PSDefaultParameterValues['*:Confirm'] = $false
}

BeforeEach {
$null = Get-DbaPfDataCollectorSetTemplate -Template 'Long Running Queries' |
Import-DbaPfDataCollectorSetTemplate |
Get-DbaPfDataCollector |
Get-DbaPfDataCollectorCounter -Counter '\LogicalDisk(*)\Avg. Disk Queue Length' |
Remove-DbaPfDataCollectorCounter
}

AfterAll {
$null = Get-DbaPfDataCollectorSet -CollectorSet 'Long Running Queries' | Remove-DbaPfDataCollectorSet -Confirm:$false
$null = Get-DbaPfDataCollectorSet -CollectorSet 'Long Running Queries' |
Remove-DbaPfDataCollectorSet
}

Context "When adding a counter to a data collector" {
BeforeAll {
$splatAddCounter = @{
CollectorSet = 'Long Running Queries'
Counter = '\LogicalDisk(*)\Avg. Disk Queue Length'
}
$results = Get-DbaPfDataCollectorSet @splatAddCounter | Get-DbaPfDataCollector | Add-DbaPfDataCollectorCounter @splatAddCounter
}

It "Returns the correct DataCollectorSet" {
$results.DataCollectorSet | Should -Be 'Long Running Queries'
}
Expand Down

0 comments on commit f23f7c6

Please sign in to comment.