Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests - use new Test-Config instead of constants.ps1 #9524

Merged
merged 26 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updates
  • Loading branch information
potatoqualitee committed Oct 21, 2024
commit 950686a3042d7da9a4c0e08077f701ed7481c6ea
6 changes: 3 additions & 3 deletions tests/New-DbaSsisCatalog.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
Context "Catalog is added properly" {
# database name is currently fixed
$database = "SSISDB"
$db = Get-DbaDatabase -SqlInstance $ssisserver -Database $database
$db = Get-DbaDatabase -SqlInstance $TestConfig.ssisserver -Database $database

if (-not $db) {
$password = ConvertTo-SecureString MyVisiblePassWord -AsPlainText -Force
$results = New-DbaSsisCatalog -SqlInstance $ssisserver -Password $password -WarningAction SilentlyContinue -WarningVariable warn
$results = New-DbaSsisCatalog -SqlInstance $TestConfig.ssisserver -Password $password -WarningAction SilentlyContinue -WarningVariable warn

# Run the tests only if it worked (this could be more accurate but w/e, it's hard to test on appveyor)
if ($warn -match "not running") {
Expand All @@ -36,7 +36,7 @@ Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
It "creates the catalog" {
$results.Created | Should Be $true
}
Remove-DbaDatabase -Confirm:$false -SqlInstance $ssisserver -Database $database
Remove-DbaDatabase -Confirm:$false -SqlInstance $TestConfig.ssisserver -Database $database
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions tests/Test-DbaDiskSpeed.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Describe "$CommandName Integration Tests" -Tag "IntegrationTests" {
$results = @($TestConfig.instance1, $TestConfig.instance2) | Test-DbaDiskSpeed -Database master
$results.Count | Should -Be 4

# for some reason this doesn't work on AppVeyor, perhaps due to the way the instances are started up the instance names do not match the values in constants.ps1
# for some reason this doesn't work on AppVeyor, perhaps due to the way the instances are started up the instance names do not match the values in Get-TestConfig
#(($results.SqlInstance -contains $TestConfig.instance1) -and ($results.SqlInstance -contains $TestConfig.instance2)) | Should -Be $true
}

Expand Down Expand Up @@ -181,7 +181,7 @@ Describe "$CommandName Integration Tests" -Tag "IntegrationTests" {
}

# Separate test to run against a Linux-hosted SQL instance.
# To run this test ensure you have specified the instance2 values for a Linux-hosted SQL instance in the constants.ps1
# To run this test ensure you have specified the instance2 values for a Linux-hosted SQL instance in the Get-TestConfig
It -Skip "test commands on a Linux instance" {
# use instance with credential info and run through the 3 variations
# -Skip to be added when checking in the code
Expand All @@ -207,7 +207,7 @@ Describe "$CommandName Integration Tests" -Tag "IntegrationTests" {
}

# Separate test to run against a Linux-hosted SQL instance.
# To run this test ensure you have specified the instance2 values for a Linux-hosted SQL instance in the constants.ps1
# To run this test ensure you have specified the instance2 values for a Linux-hosted SQL instance in the Get-TestConfig
It -Skip "aggregate by file and check column names returned on a Linux instance" {
# check returned columns
[object[]]$expectedColumnArray = 'ComputerName', 'InstanceName', 'SqlInstance', 'Database', 'SizeGB', 'FileName', 'FileID', 'FileType', 'DiskLocation', 'Reads', 'AverageReadStall', 'ReadPerformance', 'Writes', 'AverageWriteStall', 'WritePerformance', 'Avg Overall Latency', 'Avg Bytes/Read', 'Avg Bytes/Write', 'Avg Bytes/Transfer'
Expand Down Expand Up @@ -247,7 +247,7 @@ Describe "$CommandName Integration Tests" -Tag "IntegrationTests" {
}

# Separate test to run against a Linux-hosted SQL instance.
# To run this test ensure you have specified the instance2 values for a Linux-hosted SQL instance in the constants.ps1
# To run this test ensure you have specified the instance2 values for a Linux-hosted SQL instance in the Get-TestConfig
It -Skip "aggregate by database and check column names returned on a Linux instance" {
# check returned columns
[object[]]$expectedColumnArray = 'ComputerName', 'InstanceName', 'SqlInstance', 'Database', 'DiskLocation', 'Reads', 'AverageReadStall', 'ReadPerformance', 'Writes', 'AverageWriteStall', 'WritePerformance', 'Avg Overall Latency', 'Avg Bytes/Read', 'Avg Bytes/Write', 'Avg Bytes/Transfer'
Expand Down Expand Up @@ -287,7 +287,7 @@ Describe "$CommandName Integration Tests" -Tag "IntegrationTests" {
}

# Separate test to run against a Linux-hosted SQL instance.
# To run this test ensure you have specified the instance2 values for a Linux-hosted SQL instance in the constants.ps1
# To run this test ensure you have specified the instance2 values for a Linux-hosted SQL instance in the Get-TestConfig
It -Skip "aggregate by disk and check column names returned on a Linux instance" {
# check returned columns
[object[]]$expectedColumnArray = 'ComputerName', 'InstanceName', 'SqlInstance', 'DiskLocation', 'Reads', 'AverageReadStall', 'ReadPerformance', 'Writes', 'AverageWriteStall', 'WritePerformance', 'Avg Overall Latency', 'Avg Bytes/Read', 'Avg Bytes/Write', 'Avg Bytes/Transfer'
Expand Down
Loading