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

Pester migration - Second batch #9530

Merged
merged 29 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8b93039
revert to re-fix
potatoqualitee Oct 25, 2024
c4bcd7b
update instructions to be a little shorter
potatoqualitee Oct 25, 2024
43ce0a5
follow slightly new format
potatoqualitee Oct 25, 2024
7c61359
uncomment skipper
potatoqualitee Oct 25, 2024
69b7dc3
Update tests
potatoqualitee Oct 25, 2024
fca2562
fix param checker - we will be checking for whatif and confirm
potatoqualitee Oct 25, 2024
b5be793
shorten var, fix test
potatoqualitee Oct 25, 2024
a09937f
lez see
potatoqualitee Oct 25, 2024
664904e
move param test
potatoqualitee Oct 25, 2024
a6958ca
fix failures
potatoqualitee Oct 25, 2024
eaabf51
one change
potatoqualitee Oct 25, 2024
ebe6660
ReorgParams
potatoqualitee Oct 25, 2024
8e085ac
i dunno
potatoqualitee Oct 25, 2024
a92e29f
maybe
potatoqualitee Oct 25, 2024
9ac5114
trying to get it to work locally
potatoqualitee Oct 26, 2024
e48f744
who knows, im about to skip it
potatoqualitee Oct 26, 2024
3c085e6
add defaults
potatoqualitee Oct 26, 2024
4e85fba
move things
potatoqualitee Oct 26, 2024
b3f5560
add defaults
potatoqualitee Oct 26, 2024
03d1cc6
move it back to top, expected is needed for the foreach
potatoqualitee Oct 26, 2024
2e02db1
aider cleanup
potatoqualitee Oct 26, 2024
244e129
fix test
potatoqualitee Oct 26, 2024
720dc05
it should just be skipped, it shouldnt try to bring over the notifica…
potatoqualitee Oct 26, 2024
f23f7c6
that test got all kinds of messed up
potatoqualitee Oct 26, 2024
2339c66
oops, forgot to actually run the code (do Add-DbaPfDataCollectorCounter)
potatoqualitee Oct 26, 2024
e26b8b7
fix scope
potatoqualitee Oct 26, 2024
881bfc2
fix scope
potatoqualitee Oct 26, 2024
ffddf03
fix prompt
potatoqualitee Oct 26, 2024
addd41f
turns out the scoping was right all along
potatoqualitee Oct 26, 2024
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
move things
  • Loading branch information
potatoqualitee committed Oct 26, 2024
commit 4e85fba976cf38d83ab9e8f4a441aa316f3402ff
10 changes: 7 additions & 3 deletions .aider/aider.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ function Repair-Error {

Invoke-Aider @aiderParams
}
}function Repair-SmallThing {
}

function Repair-SmallThing {
[cmdletbinding()]
param (
[Parameter(Position = 0, ValueFromPipeline, ValueFromPipelineByPropertyName)]
Expand Down Expand Up @@ -284,9 +286,11 @@ function Repair-Error {
$allObjects = @()

$prompts = @{
ReorgParamTest = "Move the `$expected` parameter list AND the `$TestConfig.CommonParameters part into the 'Should have exactly the number of expected parameters' It block, keeping it between the It block declaration and the `$hasparms` assignment. Do not move the initial `$command` assignment.
ReorgParamTest = "Move the `$expected` parameter list AND the `$TestConfig.CommonParameters` part into the BeforeAll block, placing them after the `$command` assignment. Keep them within the BeforeAll block. Do not move or modify the initial `$command` assignment.

If you can't find the `$expected` parameter list, do not make any changes.

If you can't find the `$expected` parameter list, do not make any changes."
If it's already where it should be, do not make any changes."
}
Write-Verbose "Available prompt types: $($prompts.Keys -join ', ')"

Expand Down
8 changes: 5 additions & 3 deletions .aider/prompts/conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
## Core Requirements
```powershell
#Requires -Module @{ ModuleName="Pester"; ModuleVersion="5.0"}
param($ModuleName = "dbatools")
$global:TestConfig = Get-TestConfig
param(
$ModuleName = "dbatools",
$PSDefaultParameterValues = ($TestConfig = Get-TestConfig).Defaults
)
```
These three lines must start every test file.
These lines must start every test file.

## Test Structure

Expand Down
9 changes: 8 additions & 1 deletion private/testing/Invoke-ManualPester.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,14 @@ function Invoke-ManualPester {

# Remove-Module dbatools -ErrorAction Ignore
# Import-Module "$ModuleBase\dbatools.psd1" -DisableNameChecking -Force
Import-Module "$ModuleBase\dbatools.psm1" -DisableNameChecking -Force
$splatImport = @{
Name = "$ModuleBase\dbatools.psm1"
DisableNameChecking = $true
Force = $true
WarningAction = 'Ignore'
ErrorAction = 'Ignore'
}
Import-Module @splatImport

$ScriptAnalyzerRulesExclude = @('PSUseOutputTypeCorrectly', 'PSAvoidUsingPlainTextForPassword', 'PSUseBOMForUnicodeEncodedFile')

Expand Down