Skip to content
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

Add ability to pass arbitrary environment variables via envionment attribute in delivery_test_kitchen block #39

Merged
merged 2 commits into from
Jul 17, 2018

Conversation

qubitrenegade
Copy link
Contributor

Hello,

This PR is in reference to #38 .

Basically, this is the monkey-patch that I'm using to enable to me to pass Environment variables to test kitchen runs/our .kitchen.yml . The framework was already there, and everywhere it seems like it was assumed that env vars might be passed in, but the facilities to actually pass env vars was not there.

This PR enables the ability to pass environment settings a la:

env_vars = {
  'TK_EC2_REGION' => 'us-west-1'
  'foo' => 'bar',
  'CODE' => '0451',
  ...
}

  delivery_test_kitchen "kitchen_run" do
    environment env_vars
  end

If I'm being totally honest, this PR exists mostly because it reduces the monkey patching I have to do... but also if I'm trying to pass env vars, who else has a similar use case?

Thanks,

  • Q

…in delivery_test_kitchen resource block

Signed-off-by: qubitrenegade <qubitrenegade@gmail.com>
Signed-off-by: qubitrenegade <qubitrenegade@gmail.com>
@irvingpop
Copy link

This seems quite sane and useful to me. One nit: kitchen-ec2 already has an established environment variable for setting the region, so let's use that in examples rather than inventing new ones 😄

https://github.com/test-kitchen/kitchen-ec2/blob/master/lib/kitchen/driver/ec2.rb#L56

@qubitrenegade
Copy link
Contributor Author

HAHA... omg... you're totally right... I mean, I don't care about AWS... I was just trying to make the PR relevant to AWS folk in an effort to make it more appealing... two sec...

@tas50 tas50 merged commit e1c035a into chef-boneyard:master Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants