-
Notifications
You must be signed in to change notification settings - Fork 229
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
pre_create_command #249
pre_create_command #249
Conversation
As mentioned on SO, what are you trying to do? |
Current coverage is 33.33% (diff: 16.66%)@@ master #249 diff @@
==========================================
Files 2 2
Lines 228 234 +6
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 77 78 +1
- Misses 151 156 +5
Partials 0 0
|
@coderanger In order to converge our chef-run I have to prepare a test data bag (chef-vault fallback) on the developer machines containing a real password which isn't allowed to live in git. We have a script which creates this data bag, and this script must be run prior to spinning up the docker machines. In kitchen-vagrant this script is defined as a pre_create_command. |
That's probably not a good thing to do in Test Kitchen at all. If we want to support this pattern in TK it should probably be implemented in the core system so it works in every driver. That said, use of real data in TK at all should be considered a major problem. Create fixture data used only for testing and put that in git. Ping @cheeseplus re: moving this up the stack. |
@coderanger Well, in my case it is not possible to check out stash repos during provisioning without a real password, and not having passwords in git also is a valid sec guideline... |
Then don't test with stash repos, make some fake repos for testing purposes that can have less secure access credentials (or none at all, I keep a bunch of |
Also related https://github.com/poise/application_git/blob/master/test/cookbook/recipes/default.rb#L40 in case you want to hax0r my test repo :) |
This is following [equivalent work for kitchen-docker](test-kitchen/kitchen-docker#249) Example use case marcy-terui#1: Logging into AWS ECR prior to running a kitchen test so the test images can be retrieved Example use case marcy-terui#2: Running `bundle exec berks update` to refresh the Berksfile.lock prior to running tests
It looks like this feature has been implemented in the test kitchen base driver class unless I'm missing something. Also, due to inactivity, I'm going to close this PR. Please open a new PR if this feature is still needed. Thanks! |
kitchen-vagrant allows to run shell command prior to the creation of the VM. Here's an adaptation of its pre_create_command option for kitchen-docker.