Skip to content

Invoke-ManualPester claims that it supports -Show All #10144

@ReeceGoding

Description

@ReeceGoding

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

Invoke-ManualPester -Path tests/Install-DbaMaintenanceSolution.Tests.ps1 -ScriptAnalyzer -Show All -TestIntegration

PSMessageDetails :
Exception : System.Management.Automation.ParameterBindingValidationException: Cannot validate argument on parameter 'Show'. The argument "All" does not belong to the set
"None,Normal,Detailed,Diagnostic" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.
---> System.Management.Automation.ValidationMetadataException: The argument "All" does not belong to the set "None,Normal,Detailed,Diagnostic" specified by the
ValidateSet attribute. Supply an argument that is in the set and then try the command again.
at System.Management.Automation.ValidateSetAttribute.ValidateElement(Object element)
at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata,
ParameterBindingFlags flags)
--- End of inner exception stack trace ---
at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata,
ParameterBindingFlags flags)
at System.Management.Automation.CmdletParameterBinderController.BindParameter(CommandParameterInternal argument, MergedCompiledCommandParameter parameter,
ParameterBindingFlags flags)
at System.Management.Automation.CmdletParameterBinderController.BindParameter(UInt32 parameterSets, CommandParameterInternal argument,
MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
at System.Management.Automation.CmdletParameterBinderController.BindNamedParameter(UInt32 parameterSets, CommandParameterInternal argument,
MergedCompiledCommandParameter parameter)
at System.Management.Automation.ParameterBinderController.BindNamedParameters(UInt32 parameterSets, Collection1 arguments) at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection1 arguments)
at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection1 arguments) at System.Management.Automation.CommandProcessor.BindCommandLineParameters() at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues) at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues) at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream) at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input) --- End of stack trace from previous location --- at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input) at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at System.Management.Automation.Interpreter.ActionCallInstruction6.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
TargetObject :
CategoryInfo : InvalidData: (:) [Invoke-ManualPester], ParameterBindingValidationException
FullyQualifiedErrorId : ParameterArgumentValidationError,Invoke-ManualPester
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at , : line 1
PipelineIterationInfo : {}

Steps to Reproduce

Read the Show parameter's details, found here

.PARAMETER Show
Gets passed down to Pester's -Show parameter (useful if you want to reduce verbosity)
Valid values are: None, Default, Passed, Failed, Pending, Skipped, Inconclusive, Describe, Context, Summary, Header, All, Fails

Now that you know that -Show All works, try it.

I have to do it like this. I'm not sure why my method of getting Invoke-ManualPester to run is so ugly. I'm not sure if this is normal or just a quirk of my environment.

cd <wherever your local copy of dbatools is>
.'./private/testing/Invoke-ManualPester.ps1'
Invoke-ManualPester -Path tests/Install-DbaMaintenanceSolution.Tests.ps1 -ScriptAnalyzer -Show All -TestIntegration

You should now get the above error.

Please confirm that you are running the most recent version of dbatools

0.0, because I'm developing locally.

Other details or mentions

This is really the Y to my X problem. The X problem is that I'm struggling to convince myself that the "Additional backup parameters" in Install-DbaMaintenanceSolution.Tests.ps1 run. I can see warnings in appveyor

Running C:\github\dbatools\tests\Install-DbaMaintenanceSolution.Tests.ps1 ...

[00:38:26][Install-DbaMaintenanceSolution] Could not execute DatabaseIntegrityCheck.sql in tempdb on appveyor-vm\sql2022 | Log entry string is too long. A string written to the event log cannot exceed 32766 characters.

[00:38:26][Install-DbaMaintenanceSolution] Could not execute IndexOptimize.sql in tempdb on appveyor-vm\sql2022 | Log entry string is too long. A string written to the event log cannot exceed 32766 characters.

and I have yet to figure out why they get skipped on my machine. I would be interested to hear if Invoke-ManualPester -Path tests/Install-DbaMaintenanceSolution.Tests.ps1 -ScriptAnalyzer -Show Detailed -TestIntegration skips tests for anyone else.

What PowerShell host was used when producing this error

PowerShell Core (pwsh.exe)

PowerShell Host Version

Name Value


PSVersion 7.6.0-preview.6
PSEdition Core
GitCommitId 7.6.0-preview.6
OS Debian GNU/Linux forky/sid
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

SQL Server Edition and Build number

N/A

.NET Framework Version

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugs lifetriage requiredNew issue that has not been reviewed by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions