Skip to content

Test/cmdlet drift across 19 cmdlet test files (OutputType, parameters, context setup) #461

Description

@jagger

Summary

A full Pester run against the dev branch surfaced 41 pre-existing test failures where the test file's assertions no longer match the cmdlet's actual implementation. These were discovered while validating PR #460 and are unrelated to that change.

The failures cluster into three patterns, all "test drift" — the cmdlet evolved but the test wasn't updated.

Pattern 1 — Stale [OutputType] assertions (10 tests)

Each test asserts $_.OutputType.Name | Should -Be 'X' where X does not match the cmdlet's actual [OutputType()] declaration.

Test file Asserted (wrong) Actual cmdlet declares
tests/lists/Add-TssListOption.Tests.ps1 Thycotic.PowerShell.List.ListItem Thycotic.PowerShell.List.Item
tests/authentication/Close-TssSession.Tests.ps1 System.Boolean (check cmdlet)
tests/configurations/Get-TssConfigurationBackup.Tests.ps1 Thycotic.PowerShell.Configuration.DbBackup (check cmdlet)
tests/distributed-engines/Get-TssDistributedEngineServerCapabilities.Tests.ps1 Thycotic.PowerShell.DistributedEngines.ServerCapabilities (check cmdlet)
tests/distributed-engines/New-TssDistributedEngineSiteConnector.Tests.ps1 Thycotic.PowerShell.DistributedEngines.SiteConnector (check cmdlet)
tests/ipaddress-restrictions/New-TssIpRestriction.Tests.ps1 Thycotic.PowerShell.IpRestrictions.IpAddress Thycotic.PowerShell.IpRestrictions.IpRestriction
tests/distributed-engines/Remove-TssDistributedEngine.Tests.ps1 Thycotic.PowerShell.DistributedEngines.EngineActivation (check cmdlet)
tests/configurations/Set-TssConfigurationGeneral.Tests.ps1 Thycotic.PowerShell.Configuration.General (check cmdlet)
tests/secret-policies/Set-TssSecretPolicy.Tests.ps1 Class name (placeholder, never filled in) (check cmdlet)
tests/metadata/Update-TssMetadataField.Tests.ps1 Thycotic.PowerShell.Metadata.Field (check cmdlet)

Pattern 2 — Parameter assertion drift (7 tests)

Each test declares $knownParameters that no longer matches the cmdlet's real parameter set — either a renamed/removed parameter is still asserted, or a new one is missing.

Test file Mismatch
tests/authentication/New-TssSession.Tests.ps1 Missing SkipCertificateCheck (added in v0.62.0)
tests/configurations/Search-TssAutoExportStorage.Tests.ps1 SortBy no longer on cmdlet
tests/directory-services/New-TssDirectoryService.Tests.ps1 Name vs DomainName rename
tests/distributed-engines/Get-TssDistributedEngineConnectorCredential.Tests.ps1 Asserts SiteConnectorId which no longer exists
tests/distributed-engines/Register-TssDistributedEngine.Tests.ps1 IdEngineId rename
tests/distributed-engines/Unregister-TssDistributedEngine.Tests.ps1 IdEngineId rename
tests/distributed-engines/Set-TssDistributedEngineSiteConnector.Tests.ps1 7 params (Id, Name, Hostname, UseSsl, Port, TransportType, Enable) no longer match cmdlet
tests/ipaddress-restrictions/Remove-TssIpRestrictionUser.Tests.ps1 UserId no longer on cmdlet
tests/secrets/Update-TssSecret.Tests.ps1 noAutoCheckout no longer on cmdlet

Pattern 3 — BeforeAll / Context setup failures (2 tests)

Test-TssDistributedEngineSiteConnector and Update-TssList both throw CommandNotFoundException: The term 'Endpoint' is not recognized during their Context "<commandName> functions.Checking" setup. The Endpoint helper either was renamed or removed; the test setup wasn't updated.

Proposed resolution

Single PR that:

  1. Re-derives each cmdlet's actual [OutputType()] value and updates the matching Should -Be assertion.
  2. Re-derives each cmdlet's actual parameter set and rewrites the $knownParameters arrays.
  3. Investigates the Endpoint reference in the two failing context blocks and either restores the helper or rewrites the setup.

Approach: one-pass sweep similar to PR #460. Each test file gets a single-line or small-block change. Expected impact: 41 fewer failures in the runTests.ps1 baseline, no behavior change to any cmdlet.

How discovered

Full Pester suite run via tests/runTests.ps1 on the v0.62.1 branch (PR #460) on 2026-06-29. Local log captured at tempScripts/pester-459-run.log (not committed).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions