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 extend timeout for delivery_test_kitchen EC2 #10

Open
TonyLovesDevOps opened this issue Sep 8, 2016 · 0 comments
Open
Labels
Type: Enhancement Adds new functionality.

Comments

@TonyLovesDevOps
Copy link

We use heavily the delivery_test_kitchen functionality to run functional tests as part of the delivery pipeline, by calling this within .delivery/build-cookbook/recipes/functional.rb:

if node['delivery']['change']['stage'] == 'acceptance'
  delivery_test_kitchen 'functional' do
    yaml '.kitchen.ec2.yml'
    driver 'ec2'
    action [:converge, :verify, :destroy]
  end
end

This works great! However, several of our cookbooks take over 10 minutes to complete (especially ones that e.g. install a lot of packages as part of their converge), and that fails the stage and the project can't be delivered, even if the converge/verify would have succeeded eventually.

There doesn't appear to be a way to easily extend the timeout. For now, we work around this by monkey patching in each cookbook that requires the timeout to be extended:

# inside .delivery/build-cookbook/libraries/extend_timeout.rb
# Monkeypatch TestKitchen class to override default (600s) timeout to 1800s
class ::DeliverySugar::TestKitchen
  #
  # Run test kitchen action
  #
  def run(action)
    Chef::Log.warn "overriding kitchen run action"
    prepare_kitchen
    shell_out!(
      "kitchen #{action} #{suite} #{@options}",
      cwd: @repo_path,
      env: @environment.merge!('KITCHEN_YAML' => kitchen_yaml_file),
      live_stream: STDOUT,
      timeout: 1800
    )
  end
end

I'd love to see a configurabletimeout parameter added to delivery_test_kitchen. I just don't have the time right now to make a PR, so I'm making an issue instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

No branches or pull requests

2 participants