Skip to content

test: normalize core/provider/steps tests and stabilize unit runs#192

Merged
blindzero merged 16 commits intomainfrom
chore/regression-0.9.5
Feb 14, 2026
Merged

test: normalize core/provider/steps tests and stabilize unit runs#192
blindzero merged 16 commits intomainfrom
chore/regression-0.9.5

Conversation

@blindzero
Copy link
Copy Markdown
Owner

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:

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring / internal improvement

Changes

  • Normalize core tests (structure, helpers, workflow/test request patterns) and align contexts for readability.
  • Mock provider prerequisite checks so unit tests run without real modules; ensure ExchangeOnline provider tests import module at the right phase.
  • Reorganize step, packaging, and example tests for consistent Context usage and clearer intent; quiet Pester progress output.

Testing

Describe how this change was tested.

  • Unit tests
  • Contract tests
  • Manual testing

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.ps1

Checklist

  • Code follows STYLEGUIDE.md
  • Tests added or updated
  • Documentation updated
  • No UI/auth logic added to IdLE.Core
  • No breaking changes without discussion

Copilot AI review requested due to automatic review settings February 14, 2026 01:31
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Context groupings, 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>
Copilot AI review requested due to automatic review settings February 14, 2026 01:42
@blindzero blindzero merged commit f2fe97f into main Feb 14, 2026
12 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 87 out of 87 changed files in this pull request and generated no new comments.

@blindzero blindzero deleted the chore/regression-0.9.5 branch February 15, 2026 19:01
@blindzero blindzero restored the chore/regression-0.9.5 branch February 15, 2026 19:04
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