-
Notifications
You must be signed in to change notification settings - Fork 88
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
Migrate to Pester 5 #532
base: main
Are you sure you want to change the base?
Migrate to Pester 5 #532
Conversation
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.
Reviewed 29 of 29 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dan-hughes)
source/Private/Convert-CIDRToSubnetMask.ps1
line 9 at r1 (raw file):
The array of addresses to that need to be converted. #> function Convert-CIDRToSubnetMask
If these are gonna be used in the MOF resources they need to be public functions, not private. Throughout where function is needed in MOF resource.
Code quote:
Convert-CIDRToSubnetMask
tests/TestHelpers/CommonTestHelper.psm1
line 210 at r1 (raw file):
Test-NetworkTeamIntegrationEnvironment, ` New-IntegrationLoopbackAdapter, ` Remove-IntegrationLoopbackAdapter
Maybe here we should keep the export-modulemember since it says what to export even if there are more (private) functions in the module. 🤔
Code quote:
Export-ModuleMember -Function `
Get-InvalidArgumentRecord, `
Get-InvalidOperationRecord, `
Test-NetworkTeamIntegrationEnvironment, `
New-IntegrationLoopbackAdapter, `
Remove-IntegrationLoopbackAdapter
Yeah, give me a minute. I wanted to check the build worked. I'm going to get all the integration tests up and running as there are HQRM fixes required 😊 |
No worries No hurry. I saw it was not draft so when I had a minute left I just browsed through it. 🙂 |
@johlju, do you have time to starting looking through this? I have just the firewall and firewallprofile to finish off. |
I have seen this but as it was still draft I didn’t do anything, but can look into that as well, probably after the ”WSMan” PR. |
I didn't want to mark it as ready until I finished. The last tests were not Pester 5 friendly. |
@johlju, ready to go. |
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.
Reviewed 24 of 45 files at r3, 55 of 66 files at r4, 4 of 4 files at r5, 1 of 2 files at r6, 11 of 11 files at r7, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dan-hughes)
tests/TestHelpers/CommonTestHelper.psm1
line 210 at r1 (raw file):
Previously, dan-hughes (Daniel Hughes) wrote…
Yeah, give me a minute. I wanted to check the build worked. I'm going to get all the integration tests up and running as there are HQRM fixes required 😊
Should we uncomment the Export-ModuleMember block now?
tests/Integration/DSC_NetAdapterName.Integration.Tests.ps1
line 198 at r7 (raw file):
$_.ConfigurationName -eq "$($script:dscResourceName)_Config_NameOnly" }
Looks like there are blank spaces on this line, don't we have a VS Code project setting for automatically trimming white space at end of line on save? 🤔
Code quote:
···········
source/Public/Get-DnsClientServerStaticAddress.ps1
line 16 at r7 (raw file):
IP address family. #> function Get-DnsClientServerStaticAddress
I wonder if we should prefix each public function (commented on another module as well). If there is another exported command with the same name it will be a conflict, so wonder if we should prefix all commands with NetDsc
or something to make sure they are unique?
What do you think?
Code quote:
Get-DnsClientServerStaticAddress
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.
Reviewable status: 95 of 105 files reviewed, 2 unresolved discussions (waiting on @johlju)
tests/Integration/DSC_NetAdapterName.Integration.Tests.ps1
line 198 at r7 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Looks like there are blank spaces on this line, don't we have a VS Code project setting for automatically trimming white space at end of line on save? 🤔
Fixed, not sure why vscode/PSSA was not picking this up. Checked all the integration test files.
source/Public/Get-DnsClientServerStaticAddress.ps1
line 16 at r7 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
I wonder if we should prefix each public function (commented on another module as well). If there is another exported command with the same name it will be a conflict, so wonder if we should prefix all commands with
NetDsc
or something to make sure they are unique?What do you think?
Valid point, but instead of a prefix maybe a suffix instead? Then searching for usages across repos may be easier as atleast the start of the function name matches.
Pull Request (PR) description
Migrate all tests to Pester 5
This Pull Request (PR) fixes the following issues
Task list
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
and comment-based help.
This change is