-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Way of Testing with Test Kitchen #31
Comments
TK introspection seems like the better option to me, but would it be possible to let the user control whether mocking or real vault access happens? |
If we added a plugin setting Only issue with that is that If you're ok with it, I could whip up some implementation like this and we tackle the plugin config afterwards, as it extends from the supposed "main" case (using fallback in kitchen) to the "niche" case. As InSpec plugins in TK are pretty new, the impact should be negligible? |
Having mock data be the default and needing config to signal that a real vault connection should be used sounds good. Thanks again Thomas! |
Detailed Description
As
kitchen-inspec
supports loading InSpec Input plugins now, these will also be using in the TestKitchen context. To avoid having TK instances connect to production Vault (isolation issue) or developer-run Vault (network config headache), it would be good to have a facility to mock Vault outputs. This is basically the same as thechef-vault
databack fallback.Context
Currently developing a number of Vault-connected cookbooks/InSpec tests for a customer and in need to test those properly.
Possible Implementation
If I get feedback for one of these options (or another one), I will do the coding as it's needed anyway:
JSON/YAML file exchange
Could use the upload/lifecycle mechanics to get a file onto the kitchen instance, then via new plugin config connect those and use as source for mocked inputs.
This has some usability issues, as the configuration in TK will have multiple steps.
TestKitchen introspection
Have the mock data as a databag, like
chef-vault
and connect via the TK API to retrieve those, combined with a TestKitchen autodetection.This is probably best from a usability perspective and matches a known concept, but due to the lack of proper TK APIs between verifiers/provisioners, the code is borderline acceptable as it requires metaprogramming. I have done this for the
inspec-chef
plugin though:inspec-chef
The text was updated successfully, but these errors were encountered: