You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When providing a custom pester_configuration to the verifier, this almost entirely replaces the default configuration defined by the verifier.
Select values from the default hash are actually backfilled with PowerShell code if the provided configuration is missing these values, but not all values from the default hash are backfilled currently:
I would like to be able to provide a partial pester_configuration where the remaining values are backfilled with the expected defaults instead of having to provide a complete pester_configuration when I only need/want to set one or two additional values differently to the current defaults.
Steps to Reproduce
Create a kitchen environment with the following verifier configuration:
Have some basic valid Pester test files in a ./tests/ folder
Run kitchen verify
Look to see if you get test results returned to ./testresults/
Expected Result
Test results XML files are returned, respecting the default configuration.
Actual Result
No results file is returned. It seems the verifier doesn't set the pester_configuration.TestResults.Enabled value back to true if the caller is setting any values in pester_configuration, even if the values the caller is setting are unrelated to the TestResults configuration.
➕ Additional context
Looking at this SO post it seems like a better option here might be to define the actual default configuration value as { } and then keep the current default config as a predefined field in the verifier class.
When running the Pester tests, we should update our internal default hash values with the hash that test kitchen passes in via configuration rather than allowing user input to accidentally remove useful configuration.
I'm thinking, basically, we set:
default_config:pester_configuration,{)
Then we have this hash which we can copy and update from the Test Kitchen configuration:
This would remove the need to manually backfill values, at least for the Pester v5 runs. It might also probably allow us to somewhat simplify the code handling translation to pester v4.
👻 Brief Description
When providing a custom
pester_configuration
to the verifier, this almost entirely replaces the default configuration defined by the verifier.Select values from the default hash are actually backfilled with PowerShell code if the provided configuration is missing these values, but not all values from the default hash are backfilled currently:
kitchen-pester/lib/kitchen/verifier/pester.rb
Lines 279 to 303 in 6d956a6
Version
kitchen-pester v1.1.1
Scenario
I would like to be able to provide a partial pester_configuration where the remaining values are backfilled with the expected defaults instead of having to provide a complete pester_configuration when I only need/want to set one or two additional values differently to the current defaults.
Steps to Reproduce
./tests/
folderkitchen verify
./testresults/
Expected Result
Test results XML files are returned, respecting the default configuration.
Actual Result
No results file is returned. It seems the verifier doesn't set the
pester_configuration.TestResults.Enabled
value back totrue
if the caller is setting any values inpester_configuration
, even if the values the caller is setting are unrelated to the TestResults configuration.➕ Additional context
Looking at this SO post it seems like a better option here might be to define the actual default configuration value as
{ }
and then keep the current default config as a predefined field in the verifier class.When running the Pester tests, we should update our internal default hash values with the hash that test kitchen passes in via configuration rather than allowing user input to accidentally remove useful configuration.
I'm thinking, basically, we set:
Then we have this hash which we can copy and update from the Test Kitchen configuration:
And I think before passing configuration into the powershell code we should be able to do something like this:
This would remove the need to manually backfill values, at least for the Pester v5 runs. It might also probably allow us to somewhat simplify the code handling translation to pester v4.
/cc @gaelcolas @gep13 @AdmiringWorm
The text was updated successfully, but these errors were encountered: