-
-
Notifications
You must be signed in to change notification settings - Fork 803
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
Get-DbaDbCompression: Add DatabaseId to the return object #8769
Get-DbaDbCompression: Add DatabaseId to the return object #8769
Conversation
tests/Get-DbaDbCompression.Tests.ps1
Outdated
$server = Connect-DbaInstance -SqlInstance $script:instance2 | ||
$null = $server.Query("Create Database [$dbname]") | ||
$db = New-DbaDatabase -SqlInstance $script:instance2 -Database $dbname |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this line, no reason to include another module command in this test. Issuing the T-SQL command is much simpler.
tests/Get-DbaDbCompression.Tests.ps1
Outdated
$null = $server.Query("select * into syscols from sys.all_columns | ||
select * into sysallparams from sys.all_parameters | ||
create clustered index CL_sysallparams on sysallparams (object_id) | ||
create nonclustered index NC_syscols on syscols (precision) include (collation_name)", $dbname) | ||
} | ||
AfterAll { | ||
Get-DbaProcess -SqlInstance $script:instance2 -Database $dbname | Stop-DbaProcess -WarningAction SilentlyContinue | ||
Remove-DbaDatabase -SqlInstance $script:instance2 -Database $dbname -Confirm:$false | ||
$db | Remove-DbaDatabase -Confirm:$false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert.
@@ -32,8 +32,10 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" { | |||
Context "Command handles heaps and clustered indexes" { | |||
It "Gets results" { | |||
$results | Should Not Be $null | |||
$results.Database | Get-Unique | Should -Be $dbname | |||
$results.DatabaseId | Get-Unique | Should -Be $server.Query("SELECT database_id FROM sys.databases WHERE name = '$dbname'").database_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Believe this only works because we are still on Pester v4 in v5 it won't execute script commands found in the It block and would always fail. Do not have to change now because this test alone will have to be reworked anyway if we ever get around to converting to v5.
Thank you both 🙇🏼 |
Please read -- recent changes to our repo
On November 10, 2022, we removed some bloat from our repository (for the second and final time). This change requires that all contributors reclone or refork their repo.
PRs from repos that have not been recently reforked or recloned will be closed and @potatoqualitee will cherry-pick your commits and open a new PR with your changes.
Type of Change
.\tests\manual.pester.ps1
)Purpose
Minor change to add DatabaseId to the return object.
Commands to test
See current Pester tests for this command.