test: normalize core/provider/steps tests and stabilize unit runs#192
Merged
test: normalize core/provider/steps tests and stabilize unit runs#192
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to make IdLE’s Pester suites deterministic and consistently structured across Core/Providers/Steps/Packaging/Examples, while also updating the public request-creation cmdlet name and aligning docs/scripts accordingly.
Changes:
- Renames the public request factory cmdlet to
New-IdleRequest(and updates docs/tests/scripts to match). - Normalizes test structure (shared helpers, consistent
Contextgroupings, stable workflow/request creation patterns). - Improves unit-test determinism by mocking provider prerequisite checks and reducing Pester progress output noise.
Reviewed changes
Copilot reviewed 87 out of 87 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| website/sidebars.js | Updates docs sidebar to point at the renamed request cmdlet page. |
| tools/import-idle.ps1 | Updates expected public command list to New-IdleRequest and minor formatting. |
| tools/Invoke-IdlePesterTests.ps1 | Suppresses Pester progress output via ProgressPreference wrapping. |
| tests/_testHelpers.ps1 | Adds shared helpers for request creation, workflow temp files, isolated pwsh, and module layout. |
| tests/Steps/Invoke-IdleStepRevokeIdentitySessions.Tests.ps1 | Reorganizes assertions into clearer contexts and adds coverage for provider Changed flag behavior. |
| tests/Steps/Invoke-IdleStepMailboxTypeEnsure.Tests.ps1 | Restructures into Behavior/Validation contexts and expands valid mailbox-type coverage. |
| tests/Steps/Invoke-IdleStepMailboxOutOfOfficeEnsure.Tests.ps1 | Reorganizes tests into Behavior/Validation/Message format contexts. |
| tests/Steps/Invoke-IdleStepMailboxGetInfo.Tests.ps1 | Splits Behavior vs Validation contexts and clarifies AuthSessionName default behavior. |
| tests/Steps/Invoke-IdleStepEnsureEntitlement.Tests.ps1 | Groups tests into Behavior/Validation contexts for consistency. |
| tests/Steps/Invoke-IdleStepAuthSession.Tests.ps1 | Refactors auth-session routing tests to use shared helpers and cleaner setup. |
| tests/Providers/New-IdleADPassword.Tests.ps1 | Stabilizes imports/setup, improves mocks, and reduces analyzer noise for test-only patterns. |
| tests/Providers/MockIdentityProvider.Tests.ps1 | Wraps contract invocations in a Context for consistent structure. |
| tests/Providers/ExchangeOnlineProvider.Tests.ps1 | Imports provider in BeforeAll and mocks prerequisite checks for deterministic unit runs. |
| tests/Providers/ADIdentityProvider.Tests.ps1 | Mocks AD prerequisite checks so unit tests don’t require external modules. |
| tests/Packaging/PublicApi.Tests.ps1 | Updates expected command set to include New-IdleRequest and structures tests via contexts. |
| tests/Packaging/ModuleManifests.Tests.ps1 | Wraps manifest validation in a Context. |
| tests/Examples/WorkflowSamples.Tests.ps1 | Reorganizes example workflow tests and switches to New-IdleTestRequest. |
| tests/Core/Test-IdleWorkflow.Tests.ps1 | Adds strict mode and normalizes workflow file creation via helper. |
| tests/Core/Test-IdleCondition.Tests.ps1 | Adds strict mode and renames nested describes to contexts. |
| tests/Core/Resolve-IdleWorkflowTemplates.Tests.ps1 | Uses shared request helper and adds explicit noop step handler lifecycle cleanup. |
| tests/Core/Redaction.Boundaries.Tests.ps1 | Refactors into contexts for clarity and consistency. |
| tests/Core/New-IdleRequest.Tests.ps1 | Adds new unit coverage for New-IdleRequest creation/defaults and ScriptBlock rejection. |
| tests/Core/New-IdlePlan.Tests.ps1 | Normalizes structure, introduces helper-based workflow file creation, and cleans up test step handler function. |
| tests/Core/New-IdlePlan.Capabilities.Tests.ps1 | Normalizes fixtures handling and request creation; restructures test contexts. |
| tests/Core/New-IdleLifecycleRequest.Tests.ps1 | Removes old cmdlet tests in favor of New-IdleRequest. |
| tests/Core/New-IdleAuthSession.Tests.ps1 | Adds strict mode and groups module export checks into a context. |
| tests/Core/ModuleExports.Tests.ps1 | Stabilizes env/module lifecycle handling and cleans up imported modules after tests. |
| tests/Core/ModuleBootstrap.Tests.ps1 | Refactors to use shared module layout helper; updates expected cmdlet to New-IdleRequest. |
| tests/Core/Invoke-IdlePlan.StepRegistry.Tests.ps1 | Uses helper workflow file creation and request helper; improves module path handling. |
| tests/Core/Invoke-IdlePlan.Retry.Tests.ps1 | Normalizes structure, adds strict mode, and groups transient/non-transient retry cases. |
| tests/Core/Invoke-IdlePlan.ProviderFallback.Tests.ps1 | Refactors setup into BeforeEach and organizes cases into contexts. |
| tests/Core/Invoke-IdlePlan.MailboxTemplates.Tests.ps1 | Refactors into contexts and uses shared workflow helper for deterministic files. |
| tests/Core/Invoke-IdlePlan.Condition.Tests.ps1 | Refactors structure and updates request creation to New-IdleRequest. |
| tests/Core/ImportIdLE.Tests.ps1 | Restructures into contexts and uses script-scoped paths for stability. |
| tests/Core/Get-IdleProviderCapabilities.Tests.ps1 | Reorganizes tests into contexts and clarifies explicit vs inferred capability behavior. |
| tests/Core/Export-IdlePlan.Tests.ps1 | Uses shared workflow + request helpers and reduces redundant comments. |
| tests/Core/Copy-IdleRedactedObject.Tests.ps1 | Reorganizes redaction tests into a Context for consistency. |
| tests/Core/CapabilityDeprecation.Tests.ps1 | Switches to New-IdleTestRequest and improves module path handling. |
| src/IdLE/Public/New-IdleRequest.ps1 | Renames public request cmdlet wrapper and delegates to New-IdleRequestObject. |
| src/IdLE/Public/New-IdlePlan.ps1 | Updates help text to reference New-IdleRequest. |
| src/IdLE/IdLE.psm1 | Updates exported function list to New-IdleRequest. |
| src/IdLE/IdLE.psd1 | Updates manifest exports to New-IdleRequest. |
| src/IdLE.Steps.Mailbox/Public/Invoke-IdleStepMailboxOutOfOfficeEnsure.ps1 | Updates comment example to use New-IdleRequest. |
| src/IdLE.Core/Public/New-IdleRequestObject.ps1 | Renames core request factory function and updates docs/examples accordingly. |
| src/IdLE.Core/Public/New-IdlePlanObject.ps1 | Switches optional property access to the new generalized property accessor. |
| src/IdLE.Core/Public/Invoke-IdlePlanObject.ps1 | Replaces step field accessor calls with generalized property access. |
| src/IdLE.Core/Private/Test-IdlePrimitiveValue.ps1 | Adds reusable primitive-type predicate used by several utilities. |
| src/IdLE.Core/Private/Test-IdleEnumerableValue.ps1 | Adds reusable enumerable predicate for consistent recursion behavior. |
| src/IdLE.Core/Private/Test-IdleCapabilityIdentifier.ps1 | Adds reusable capability identifier validator. |
| src/IdLE.Core/Private/Resolve-IdleWorkflowTemplates.ps1 | Refactors primitive/enumerable detection into shared helpers. |
| src/IdLE.Core/Private/Resolve-IdleTemplateString.ps1 | Uses shared path resolver for template path evaluation. |
| src/IdLE.Core/Private/Resolve-IdleStepMetadataCatalog.ps1 | Refactors capability validation/normalization via shared helpers. |
| src/IdLE.Core/Private/Invoke-IdleWithRetry.ps1 | Replaces attribute validation with centralized parameter assertions. |
| src/IdLE.Core/Private/Get-IdleWorkflowStepValue.ps1 | Removes now-superseded step-value accessor. |
| src/IdLE.Core/Private/Get-IdleValueByPath.ps1 | Uses generalized property access for path traversal. |
| src/IdLE.Core/Private/Get-IdleStepField.ps1 | Removes now-superseded step-field accessor. |
| src/IdLE.Core/Private/Get-IdleProviderCapabilities.ps1 | Refactors capability normalization/validation into shared converter. |
| src/IdLE.Core/Private/Get-IdlePropertyValue.ps1 | Introduces generalized property/dictionary accessor used by multiple runtime paths. |
| src/IdLE.Core/Private/Get-IdleOptionalPropertyValue.ps1 | Removes now-superseded optional property accessor. |
| src/IdLE.Core/Private/Get-IdleAvailableCapabilities.ps1 | Centralizes capability list processing through shared converter. |
| src/IdLE.Core/Private/Copy-IdleRedactedObject.ps1 | Uses shared primitive/enumerable predicates for deterministic redaction traversal. |
| src/IdLE.Core/Private/Copy-IdleDataObject.ps1 | Uses shared primitive/enumerable predicates for deterministic cloning traversal. |
| src/IdLE.Core/Private/ConvertTo-NullIfEmptyString.ps1 | Broadens input type handling while preserving null-for-empty-string semantics. |
| src/IdLE.Core/Private/ConvertTo-IdleWorkflowSteps.ps1 | Replaces workflow-step field access helper with generalized property accessor. |
| src/IdLE.Core/Private/ConvertTo-IdleRequiredCapabilities.ps1 | Centralizes capability validation via shared helpers. |
| src/IdLE.Core/Private/ConvertTo-IdlePlanExportObject.ps1 | Removes inlined helper in favor of shared function. |
| src/IdLE.Core/Private/ConvertTo-IdleCapabilityList.ps1 | Adds shared capability list normalization/validation utility. |
| src/IdLE.Core/Private/ConvertTo-IdleCapabilityIdentifier.ps1 | Adds shared capability identifier normalization helper. |
| src/IdLE.Core/Private/Assert-IdlePlanCapabilitiesSatisfied.ps1 | Switches optional property access to generalized accessor. |
| src/IdLE.Core/Private/Assert-IdleExecutionOptions.ps1 | Adds centralized retry parameter assertion helper. |
| src/IdLE.Core/IdLE.Core.psm1 | Updates core exports to New-IdleRequestObject. |
| src/IdLE.Core/IdLE.Core.psd1 | Updates manifest exports to New-IdleRequestObject. |
| examples/Invoke-LeaverWithManagerOOF.ps1 | Updates example to use New-IdleRequest. |
| examples/Invoke-IdleDemo.ps1 | Updates example to use New-IdleRequest. |
| docs/use/workflows.md | Updates docs to use New-IdleRequest. |
| docs/use/quickstart.md | Updates docs to use New-IdleRequest. |
| docs/use/plan-export.md | Updates docs to use New-IdleRequest. |
| docs/reference/providers/provider-exchangeonline.md | Updates provider docs examples to use New-IdleRequest. |
| docs/reference/cmdlets/New-IdleRequest.md | Updates generated cmdlet reference to the new cmdlet name/signature. |
| docs/reference/cmdlets/New-IdlePlan.md | Updates cmdlet reference text to reference New-IdleRequest. |
| docs/reference/cmdlets.md | Updates cmdlet index to link to New-IdleRequest instead of the old name. |
| docs/about/concepts.md | Updates conceptual docs examples to use New-IdleRequest. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Normalize and stabilize test suites across core, providers, steps, packaging, and examples; mock provider prerequisites; and reduce Pester progress noise.
Motivation
Tests should be deterministic and runnable without external prerequisites (AD/ExchangeOnline modules). The refactor also makes test structure consistent and easier to maintain.
Type of Change
Please select the relevant option:
Changes
Testing
Describe how this change was tested.
How to test & review
./tools/Invoke-IdlePesterTests.ps1./tools/Invoke-IdlePesterTests.ps1 -Path tests/Providers/ADIdentityProvider.Tests.ps1./tools/Invoke-IdlePesterTests.ps1 -Path tests/Providers/ExchangeOnlineProvider.Tests.ps1Checklist