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

Migrate to Pester 5 #532

Draft
wants to merge 101 commits into
base: main
Choose a base branch
from
Draft

Migrate to Pester 5 #532

wants to merge 101 commits into from

Conversation

dan-hughes
Copy link

@dan-hughes dan-hughes commented Nov 24, 2024

Pull Request (PR) description

Migrate all tests to Pester 5

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation added/updated in README.md.
  • Resource parameter descriptions added/updated in README.md, schema.mof
    and comment-based help.
  • Comment-based help added/updated.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Community Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

Copy link
Member

@johlju johlju left a 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

@dan-hughes
Copy link
Author

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 😊

@dan-hughes dan-hughes marked this pull request as draft November 24, 2024 16:37
@johlju
Copy link
Member

johlju commented Nov 24, 2024

No worries No hurry. I saw it was not draft so when I had a minute left I just browsed through it. 🙂

Copy link

codecov bot commented Dec 1, 2024

Codecov Report

Attention: Patch coverage is 96.63462% with 7 lines in your changes missing coverage. Please review.

Project coverage is 83%. Comparing base (e8b5edc) to head (3b8b3a4).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
source/Public/Find-NetworkAdapter.ps1 94% 3 Missing ⚠️
source/DSCResources/DSC_Firewall/DSC_Firewall.psm1 0% 1 Missing ⚠️
source/DSCResources/DSC_NetBios/DSC_NetBios.psm1 0% 1 Missing ⚠️
source/Public/Get-DnsClientServerStaticAddress.ps1 95% 1 Missing ⚠️
...ource/Public/Get-WinsClientServerStaticAddress.ps1 93% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@         Coverage Diff          @@
##           main   #532    +/-   ##
====================================
- Coverage    97%    83%   -15%     
====================================
  Files        28     35     +7     
  Lines      2078   1998    -80     
====================================
- Hits       2028   1669   -359     
- Misses       50    329   +279     
Files with missing lines Coverage Δ
...faultGatewayAddress/DSC_DefaultGatewayAddress.psm1 95% <100%> (-1%) ⬇️
...lientGlobalSetting/DSC_DnsClientGlobalSetting.psm1 100% <100%> (ø)
...C_DnsConnectionSuffix/DSC_DnsConnectionSuffix.psm1 100% <ø> (ø)
...ces/DSC_DnsServerAddress/DSC_DnsServerAddress.psm1 92% <100%> (-1%) ⬇️
...urces/DSC_FirewallProfile/DSC_FirewallProfile.psm1 0% <ø> (-100%) ⬇️
...urce/DSCResources/DSC_HostsFile/DSC_HostsFile.psm1 97% <ø> (-1%) ⬇️
...urce/DSCResources/DSC_IPAddress/DSC_IPAddress.psm1 99% <ø> (-1%) ⬇️
...urces/DSC_IPAddressOption/DSC_IPAddressOption.psm1 100% <ø> (ø)
...vancedProperty/DSC_NetAdapterAdvancedProperty.psm1 100% <ø> (ø)
...s/DSC_NetAdapterBinding/DSC_NetAdapterBinding.psm1 98% <ø> (-1%) ⬇️
... and 25 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants