atalanta / cucumber-chef Goto Github PK
View Code? Open in Web Editor NEWFramework for test-driven infrastructure development
Home Page: http://cucumber-chef.org
License: Apache License 2.0
Framework for test-driven infrastructure development
Home Page: http://cucumber-chef.org
License: Apache License 2.0
Steps to reproduce:
ami-e2af508b
for us-east region)cucumber-chef setup
Result: The process gets as far as "Platform provisioned. Run cucumber-chef project to get started." and never returns or prints further output. (I waited over an hour for completion. I also SSH'ed into the instance to see if Chef or LXC or anything else was being setup. As far as I could tell, there was no activity.)
Suggestions:
--verbose
or --debug
flag.)In my step definition:
Then /^the server should have a new file$/ do
run_remote_command("appserver", "ls /tmp")
end
Result:
Scenario: Example scenario for example # /home/ubuntu/example/features/example.feature:6
Given I have a new server # example/features/step_definitions/example_step.rb:1
And I apply the example recipe # example/features/step_definitions/example_step.rb:5
ssh: Could not resolve hostname workstation.testlab: Name or service not known
Then the server should have a new file # example/features/step_definitions/example_step.rb:10
1 scenario (1 passed)
3 steps (3 passed)
0m7.120s
Hey guys,
So I am super interested in tying this into continuous delivery with a CI server. Any thoughts on the type of workflow you suggest using chef server to promote your changes. I'm trying to map out the best workflow that will work with continuous delivery of our infrastructure code.
Thanks,
Jay
Hi
Following along in the book, and at point of trying to get cucumber-chef setup running.
It provisions just fine, then when it gets to the cucumber-chef setup phase, fails with Permission Denied error (Errno::EACCES).
It appears to be trying to connect with the key baked into the gem instead of the one specified in knife.
glenn/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/cucumber-chef-1.0.3/cookbooks/cucumber-chef/files/default/cucumber-private-key
I can connect fine manually using ssh and the key specified in the knife config.
Ironically, even though the project test lab hasn't been able to setup, any attempt to create another before terminating the instance, results in 'A test lab already exists using the AWS credentials you supplied'
Any ideas what i might need to do?
Thanks
Here's my knife.rb incase you see any issues:
current_dir = File.dirname(__FILE__)
user = ENV['OPSCODE_USER'] || ENV['USER']
log_level :info
log_location STDOUT
node_name "glenndavy"
client_key "#{ENV['HOME']}/.chef/#{user}.pem"
validation_client_name "#{ENV['ORGNAME']}-validator"
validation_key "#{ENV['HOME']}/.chef/#{ENV['ORGNAME']}-validator.pem"
chef_server_url "https://api.opscode.com/organizations/#{ENV['ORGNAME']}"
cache_type 'BasicFile'
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path ["#{current_dir}/../cookbooks"]
knife[:aws_access_key_id] = ENV['AWS_ACCESS_KEY_ID']
knife[:aws_secret_access_key] = ENV['AWS_SECRET_ACCESS_KEY']
knife[:identity_file] = "/Users/glenn/.ssh/tdd-eg.pem"
knife[:aws_ssh_key_id] = "tdd-eg" #ENV['AWS_SSH_KEY_ID]'
knife[:availability_zone] = "us-east-1e"
knife[:region] = "us-east-1"
knife[:aws_image_id] = "ami-0493486d"
#knife[:ssh_user] = 'ubuntu'
The cucumber-chef.gemspec
(v1.0.3) executes the following dependency statements when Rubygems higher than 1.2 is used:
s.add_runtime_dependency(%q<rake>, ["~> 0.9.2"])
s.add_runtime_dependency(%q<chef>, [">= 0.10.2"])
s.add_runtime_dependency(%q<fog>, [">= 0"])
s.add_runtime_dependency(%q<thor>, [">= 0"])
s.add_runtime_dependency(%q<net-scp>, [">= 0"])
s.add_development_dependency(%q<cucumber>, [">= 0"])
s.add_development_dependency(%q<cucumber-nagios>, [">= 0"])
s.add_development_dependency(%q<rspec>, [">= 0"])
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
s.add_development_dependency(%q<rcov>, [">= 0"])
Cucumber and Cucumber-Nagios are declared as development dependencies, meaning they're not installed in a simple gem install cucumber-chef
call. This would make sense for some use cases, but for Cucumber-Chef these are very much runtime dependencies, required by the gem's core function. They should be declared as such so that they're installed alongside the gem.
(I already had Cucumber on my system, but ran into a "no such file to load -- cucumber/nagios/steps (LoadError)" on first test invocation.)
Hi,
I'm new to cucumber-chef so I'm probably missing something, is cucumber-chef somehow able to synchronize cookbooks with the test lab? I mean, for roles we can use the step definition:
* the following roles have been updated:
| role | role_path |
| mongodb | ./support/roles/ |
but for cookbooks I couldn't find how to do it
Bye
Make cucumber-chef use ubuntu-ami library to determine which AMI to use.
Provisioner#bootstrap_node output is written out to the terminal when running the random node name test.
The project generator includes a dependency on cucumber/nagios/steps
in the support/env.rb file. I'm not sure whether this is critical to Cucumber-Chef's operation, but I was loath to take it out. However, it causes cucumber test
runs to fail, because the cookbook uploaded to the test lab doesn't install the cucumber-nagios gem.
I'm sending a pull request that fixes this and other issues.
Node information isn't immediately available via search (TestLab#nodes) so the test sometimes falls over.
Hi,
Cucumber chef should work with a chef server behind the firewall right? All cucumber is using is your knife.rb settings right?
1.x had intelligent config file finding, which looked iteratively up the filesystem, before defaulting to ~/.chef/knife.rb
2.x has no such feature, which means that cucumber-chef needs to be run from the same directory as the config file.
It would be nice if 2.x looked for config.rb in the same way.
execute[lxc-create -n controller -f /etc/lxc/controller -t lucid-chef] (cucumber-chef::controller line 30) had an error: Expected process to exit with [0], but received '1'
---- Begin output of lxc-create -n controller -f /etc/lxc/controller -t lucid-chef ----
STDOUT: unknown template 'lucid-chef'
STDERR: /usr/bin/lxc-create: line 132: type: /usr/lib/lxc/templates/lxc-lucid-chef: not found
---- End output of lxc-create -n controller -f /etc/lxc/controller -t lucid-chef ----
Ran lxc-create -n controller -f /etc/lxc/controller -t lucid-chef returned 1
b9cb52b4 (Maciej Pasternacki 2011-08-05 14:39:27 +0200 26) template "/usr/bin/lxc-lucid-chef" do
^481d00f (Stephen Nelson-Smith 2011-06-14 12:28:56 +0100 27) source "lxc-lucid-chef"
^481d00f (Stephen Nelson-Smith 2011-06-14 12:28:56 +0100 28) mode "0755"
^481d00f (Stephen Nelson-Smith 2011-06-14 12:28:56 +0100 29) variables( :orgname => node["cucumber-chef"]["orgname"] )
^481d00f (Stephen Nelson-Smith 2011-06-14 12:28:56 +0100 30) action :create
^481d00f (Stephen Nelson-Smith 2011-06-14 12:28:56 +0100 31) end
commit b9cb52b
Author: Maciej Pasternacki [email protected]
Date: Fri Aug 5 14:39:27 2011 +0200
Install lxc-lucid-chef template in /usr/bin where lxc-create expects to find it.
Was:
^481d00f (Stephen Nelson-Smith 2011-06-14 12:28:56 +0100 26) template "/usr/lib/lxc/templates/lxc-lucid-chef" do
Why is this broken for me?
Not so much an issue, more a possibly-useful hack: https://gist.github.com/3360194
sns@tdi:$ cucumber-chef displayconfig
/home/sns/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-chef-2.0.0.rc1/bin/cucumber-chef:335:in rescue in displayconfig': undefined method
fatal' for nil:NilClass (NoMethodError)
from /home/sns/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-chef-2.0.0.rc1/bin/cucumber-chef:328:in displayconfig' from /home/sns/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/thor-0.15.2/lib/thor/task.rb:27:in
run'
from /home/sns/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/thor-0.15.2/lib/thor/invocation.rb:120:in invoke_task' from /home/sns/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/thor-0.15.2/lib/thor.rb:275:in
dispatch'
from /home/sns/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/thor-0.15.2/lib/thor/base.rb:408:in start' from /home/sns/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-chef-2.0.0.rc1/bin/cucumber-chef:407:in
<top (required)>'
from /home/sns/.rbenv/versions/1.9.3-p194/bin/cucumber-chef:23:in load' from /home/sns/.rbenv/versions/1.9.3-p194/bin/cucumber-chef:23:in
Digging deeper, this seems to fail because of the logger constructor failing to find a parent of .chef.
Running cucumber-chef project
, the Thor task generates the example features, readme and steps. However it also creates two bogus files in the current working directory:
$ tree
.
├── foo
│ ├── README
│ └── features
│ ├── example.feature
│ ├── step_definitions
│ │ └── example_step.rb
│ └── support
│ └── env.rb
├── foofeaturesstep_definitions
└── foofeaturessupport
The last two files are bogus.
That's what I get:
$ cucumber-chef test base
Cucumber-chef project: base sucessfully uploaded to the test lab.
no such file to load -- cucumber/nagios/steps (LoadError)
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/ubuntu/base/features/support/env.rb:6
/usr/lib/ruby/gems/1.8/gems/cucumber-1.0.2/bin/../lib/cucumber/rb_support/rb_language.rb:143:in `load'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.0.2/bin/../lib/cucumber/rb_support/rb_language.rb:143:in `load_code_file'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.0.2/bin/../lib/cucumber/runtime/support_code.rb:176:in `load_file'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.0.2/bin/../lib/cucumber/runtime/support_code.rb:78:in `load_files!'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.0.2/bin/../lib/cucumber/runtime/support_code.rb:77:in `each'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.0.2/bin/../lib/cucumber/runtime/support_code.rb:77:in `load_files!'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.0.2/bin/../lib/cucumber/runtime.rb:137:in `load_step_definitions'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.0.2/bin/../lib/cucumber/runtime.rb:39:in `run!'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.0.2/bin/../lib/cucumber/cli/main.rb:43:in `execute!'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.0.2/bin/../lib/cucumber/cli/main.rb:20:in `execute'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.0.2/bin/cucumber:14
/usr/bin/cucumber:19:in `load'
/usr/bin/cucumber:19
The problem goes away after ssh'ing to Test Lab and running
gem install cucumber-nagios
Any thoughts of making this work with vagrant?
Hi
I have an idea for an enhancement, so I've checked out my fork and am running it with e.g. bundle exec bin/cucumber-chef test
. The output I see is
$ bundle exec bin/cucumber-chef test
cucumber-chef v2.0.1.patch
Using features directory: /Users/sam/cuke-chef/features
Cucumber-Chef Test Runner Initalized!
Cleaning up any previous test runs...done.
Uploading files required for this test run...done.
Executing Cucumber-Chef Test Runner
@teamserver
Feature: Tech team members can log into team server
Background: # ./teamserver/teamserver.feature:4
>>> servers are being preserved
* I have a server called "teamserver" # cucumber-chef-2.0.1/lib/cucumber/chef/steps/provision_steps.rb:22
* "teamserver" should be persistant # cucumber-chef-2.0.1.pre/lib/cucumber/chef/steps/provision_steps.rb:34
* "teamserver" is running "ubuntu" "lucid" # cucumber-chef-2.0.1.pre/lib/cucumber/chef/steps/provision_steps.rb:26
* "teamserver" has been provisioned # cucumber-chef-2.0.1.pre/lib/cucumber/chef/steps/provision_steps.rb:46
etc, etc
I've changed the version string (so I get cucumber-chef v2.0.1.patch
at the top there) but then I get cucumber-chef-2.0.1.pre/lib/cucumber/chef/steps/provision_steps.rb:22
and so on. I've tried editing those lines in my working repo - I've inserted blanks to change the line numbers, I've even commented out that whole provision_steps.rb file - and I still get exactly the same output. It's clearly not touching my local code at all. I have no references to 2.0.1.pre anywhere. The cucumber-chef gem is not installed in this gemset. Where the hell is that coming from? It's like it's cached somewhere.
Chances are, I'm doing something extremely dumb (I'm definitely more Ops than Dev), but has anybody got any ideas please? This enhancement will be awesome, promise :)
Sam
lib/cucumber/chef/test_runner.rb will need some changes for non-Ubuntu based distros (i.e. different home dirs, ssh unames, etc). Will work this weekend on a fork that determines distro type from image-id and executes run() and upload_project() appropriately.
Following the instructions in the book (building ruby 1.9.2 under rvm, with a new gemset for chef), cucumber-chef installs successfully but fails at runtime due to missing dependencies.
Using gem to install "awesome_print" and "net-scp" satisfies those dependencies.
Hi
I've encountered a bug in the cucumber-chef setup
step: it started up OK, but then sat at the Bootstrapping AWS EC2 instance...
step forever (I killed it after an hour).
I eventually discovered (after trying to restart the previously-stalled instance) the problem:
Downloading container SSH credentials...//Users/sam/.rvm/gems/ruby-1.9.2-p320@cuke-chef/gems/net-sftp-2.0.5/lib/net/sftp/operations/download.rb:307:in `on_open': open /home/ubuntu/.ssh/id_rsa: no such file (2) (RuntimeError)
Aha! So I jumped on the box and did a bit of ssh-keygen
, ran setup again, and now it works.
This was using cucumber-chef-2.0.1.pre on my 10.6 Mac.
Anybody else come across this?
Sam
wondering if you can help me make sense of this error. I 've used the basic provisioning steps, and the attempt to run the chef-client in the container is faling:
* the chef-client has been run on "xyz" # cucumber-chef-2.0.1.pre/lib/cucumber/chef/steps/provision_steps.rb:58
command_run_remote(/usr/bin/chef-client -j /etc/chef/attributes.json -N xyz ) failed (65280) (RuntimeError)
./xyz/xyz.feature:14:in `* the chef-client has been run on "xyz"'
Anything else I might have over looked?
This doesn't work:
[tmp] cucumber-chef test
"test" was called incorrectly. Call as "cucumber-chef test".
If I name a feature, the test runs:
[tmp] cucumber-chef test example
Cucumber-chef project: example sucessfully uploaded to the test lab.
...
sns@tdi:/chef-repo/cookbooks$ cc-knife node list
cc-knife v2.0.0.rc1
/usr/bin/env knife node list -s http://54.247.15.40:4000 -c /home/sns/chef-repo/.cucumber-chef/knife.rb 2>&1
cucumber-chef.test-lab
wonderstuff
/home/sns/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-chef-2.0.0.rc1/bin/cc-knife:23:in exit': can't convert Process::Status into Integer (TypeError) from /home/sns/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-chef-2.0.0.rc1/bin/cc-knife:23:in
<top (required)>'
from /home/sns/.rbenv/versions/1.9.3-p194/bin/cc-knife:23:in load' from /home/sns/.rbenv/versions/1.9.3-p194/bin/cc-knife:23:in
exit': can't convert Process::Status into Integer (TypeError) from /home/sns/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/cucumber-chef-2.0.0.rc1/bin/cc-knife:23:in
<top (required)>'load' from /home/sns/.rbenv/versions/1.9.3-p194/bin/cc-knife:23:in
'Brians-MacBook-Pro:cucumber-chef bhenerey$ cucumber-chef setup
Provisioning cucumber-chef test lab platform.
Instance ID: i-8a4ba9f3
State: running
Username: ubuntu
IP Address:
Public...: 50.16.90.218
Private..: 10.190.101.78
DNS:
Public...: ec2-50-16-90-218.compute-1.amazonaws.com
Private..: ip-10-190-101-78.ec2.internal
Tags:
cucumber-chef: user
run(/Users/bhenerey/.rvm/gems/ruby-1.9.3-p194@cucumber-chef/bin/knife
search node "tags:user AND name:cucumber-chef*" -a name -F json -c /Users/bhenerey/chef-repo/cucumber-chef/.cucumber-chef/knife.rb --color -n 2>&1) failed! [pid 95541 exit 127]
[01/06/2012 14:54:30] Brian Henerey: looking for knife.rb which it should be looking for config.rb
Hi,
Am I the only one that has this problem?
I specify a security group in my knife config with :
knife[:aws_security_group] = "my-existing-security-group"
but the instance created by cucumber chef is always default..
A
Hi,
Do you know if there is a way to create a centos lxc container or since cucumber-chef only supports an ubuntu test lab that it can only create ubuntu lxc containers? If this is possible could you point me to correct documentation on how to do this through cucumber chef as this may be a deal breaker for us since most of our systems are CentOS.
Thanks,
Jay
cucumber-chef gem built from git source doesn't set up Test Lab:
NoMethodError: undefined method `each' for nil:NilClass
/var/chef/cache/cookbooks/cucumber-chef/recipes/test_lab.rb:5:in `from_file'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/cookbook_version.rb:578:in `load_recipe'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/mixin/language_include_recipe.rb:40:in `include_recipe'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `include_recipe'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/run_context.rb:72:in `load'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/run_context.rb:69:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/run_context.rb:69:in `load'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/client.rb:195:in `setup_run_context'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/client.rb:159:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/client.rb:239:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/client.rb:229:in `loop'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/client.rb:229:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application.rb:67:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/chef-client:26
/usr/bin/chef-client:19:in `load'
/usr/bin/chef-client:19
The problem is caused by node['cucumber-chef'][:gems] returning nil here:
node['cucumber-chef'][:gems].each do |gem|
gem_package gem
end
I'm currently having a problem (unrelated to cucumber-chef) where my new EC2 instance is unreachable. This causes cucumber-chef setup
to fail, but the instance is left in the "running" state.
Provisioning cucumber-chef test lab platform.
Waiting for server...................
Instance ID: i-009be476 ; IP Address 46.137.60.137
Platform provisioned. Run cucumber-chef project to get started.
WARNING: Failed to connect to ec2-46-137-60-137.eu-west-1.compute.amazonaws.com -- Errno::ETIMEDOUT: Operation timed out - connect(2)
/Users/zts/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/http.rb:2303:in`error!': 404 "Not Found" (Net::HTTPServerException)
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.0/lib/chef/rest.rb:237:in `block in api_request'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.0/lib/chef/rest.rb:288:in`retriable_rest_request'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.0/lib/chef/rest.rb:218:in `api_request'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.0/lib/chef/rest.rb:114:in`get_rest'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/chef-0.10.0/lib/chef/node.rb:603:in `load'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/cucumber-chef-1.0.0/lib/cucumber/chef/provisioner.rb:74:in`tag_node'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/cucumber-chef-1.0.0/lib/cucumber/chef/provisioner.rb:31:in `bootstrap_node'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/cucumber-chef-1.0.0/bin/cucumber-chef:78:in`setup'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/thor-0.14.6/lib/thor/invocation.rb:118:in`invoke_task'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/thor-0.14.6/lib/thor/base.rb:389:in`start'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/gems/cucumber-chef-1.0.0/bin/cucumber-chef:139:in `<top (required)>'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/bin/cucumber-chef:19:in`load'
from /Users/zts/.rvm/gems/ruby-1.9.2-p180@chef/bin/cucumber-chef:19:in `<main>'
Ideally, setup
would attempt to terminate the running instance before returning control to the shell.
Minimally, a warning should be printed, advising the user to manually terminate the instance in the AWS management console.
jeweler doesn't play nicely with Bundler - remove the dependency on jeweler and put gemspec back into the Gemfile. Need a replacement with equivalents to rake release etc. (possibly https://github.com/svenfuchs/gem-release).
Hey Stephen! Had a quick exchange with you on Twitter, and just wanted to follow up.
I don't know if I knowledgeable enough at the moment to take a frontline role on the code, but if it's alright with you, I wouldn't mind helping to organize the issue queues and wiki. Just thinking aggregating features requests and maybe a rough roadmap.
Seems that the opscode guys are starting to thinking about version-controlling tests with community cookbooks, so I'm trying to get a feel for which framework/approach works best. Really like the system you've got going :)
Hi. So I've bought your O'Reilly book and I'm trying to put Cucumber-Chef to work as described. However, I'm having a hard time finding useful references apart from the book's limited examples. Specific concerns:
Again, if there's anyplace else I can look for help on how to get Cucumber-Chef running, please let me know. You've versioned the gem at 1.0 (universally understood to be "production-ready") and you've published a book about it. Given that expectations you've set about this tool's maturity, I don't think it's unreasonable to assert that basic usage information ought to exist somewhere and be readily discoverable.
I'm trying to setup cucumber-chef and I'm having some issues.
cucumber-chef setup
Provisioning cucumber-chef test lab platform.
Waiting for server................
Instance ID: i-xxxxxxxx ; IP Address xxx.xxx.xxx.xxx
Platform provisioned. Run cucumber-chef project to get started.
I left the setup process running for 1 hour and it still wasn't done.
I don't see the node in my hosted chef console.
Is there a way to see what's happening during the setup? (--verbose, --trace, log?)
Anyone having this problem?
A
I have been reworking some major parts of cucumber-chef along with fixing various issues. Since Atalanta appears to not maintain this project with any regularity I will not be pushing pull request to this repo since, if you look at the history over the past 8 months, most pull requests sit in limbo. That being said I will ultimately be changing the name of my project so I can actually push the gem out via rubygems unless Atalanta wants to give me the rights to publish the cucumber-chef gem on rubygems.
I have things working at this point; but it's not quite in at the stage to be distributed. Feel free to play around with my fork of the project; feed back is certainly welcome.
I have my .chef/knife.rb
as:
current_dir = File.dirname(__FILE__)
user = ENV['OPSCODE_USER'] || ENV['USER']
ENV['ORGNAME'] ||= (ENV['OPSCODE_ORGNAME'] || "#{user}-test")
orgname = ENV['ORGNAME']
chef_home = "#{ENV['HOME']}/.chef"
knife[:aws_access_key_id] = ENV['AWS_ACCESS_KEY_ID'] || Fog.credentials[:aws_access_key_id]
knife[:aws_secret_access_key] = ENV['AWS_SECRET_ACCESS_KEY'] || Fog.credentials[:aws_secret_access_key]
knife[:identity_file] = '~/.ec2/id_rsa-ec2'
knife[:aws_ssh_key_id] = ENV['AWS_SSH_KEY_ID'] || 'drnic'
knife[:availability_zone] = 'us-east-1a'
knife[:region] = 'us-east-1'
knife[:aws_image_id] = 'ami-a403f7cd' # http://aws.amazon.com/amis/Community/4347
log_level :info
log_location STDOUT
node_name user
client_key "#{chef_home}/#{user}.pem"
validation_client_name "#{orgname}-validator"
validation_key "#{chef_home}/#{orgname}-validator.pem"
chef_server_url "https://api.opscode.com/organizations/#{orgname}"
cache_type 'BasicFile'
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path ["#{current_dir}/../cookbooks"]
And I ran:
$ gem list cucumber-chef
cucumber-chef (1.0.3)
$ cucumber-chef project teamserver
$ cucumber-chef test teamserver
/Users/drnic/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-chef-1.0.3/lib/cucumber/chef/test_lab.rb:59:in `public_hostname': undefined method `cloud' for nil:NilClass (NoMethodError)
from /Users/drnic/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-chef-1.0.3/lib/cucumber/chef/test_runner.rb:25:in `upload_project'
from /Users/drnic/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-chef-1.0.3/lib/cucumber/chef/test_runner.rb:15:in `run'
from /Users/drnic/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-chef-1.0.3/bin/cucumber-chef:120:in `test'
from /Users/drnic/.rvm/gems/ruby-1.9.2-p180/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /Users/drnic/.rvm/gems/ruby-1.9.2-p180/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /Users/drnic/.rvm/gems/ruby-1.9.2-p180/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
from /Users/drnic/.rvm/gems/ruby-1.9.2-p180/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from /Users/drnic/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-chef-1.0.3/bin/cucumber-chef:123:in `<top (required)>'
from /Users/drnic/.rvm/gems/ruby-1.9.2-p180/bin/cucumber-chef:19:in `load'
from /Users/drnic/.rvm/gems/ruby-1.9.2-p180/bin/cucumber-chef:19:in `<main>'
Ideas?
Version: cucumber-chef-1.0.4
ubuntu-ami library should be used to determine the ami automatically (issue #20)
/var/lib/gems/1.9.1/gems/cucumber-chef-1.0.4/lib/cucumber/chef/config.rb:87:in `aws_image_id': uninitialized constant UbuntuAmi (NameError)
from /var/lib/gems/1.9.1/gems/cucumber-chef-1.0.4/lib/cucumber/chef/config.rb:66:in `list'
from /var/lib/gems/1.9.1/gems/cucumber-chef-1.0.4/bin/cucumber-chef:77:in `displayconfig'
from /var/lib/gems/1.9.1/gems/thor-0.15.2/lib/thor/task.rb:27:in `run'
from /var/lib/gems/1.9.1/gems/thor-0.15.2/lib/thor/invocation.rb:120:in `invoke_task'
from /var/lib/gems/1.9.1/gems/thor-0.15.2/lib/thor.rb:275:in `dispatch'
from /var/lib/gems/1.9.1/gems/thor-0.15.2/lib/thor/base.rb:408:in `start'
from /var/lib/gems/1.9.1/gems/cucumber-chef-1.0.4/bin/cucumber-chef:123:in `<top (required)>'
from /usr/local/bin/cucumber-chef:19:in `load'
from /usr/local/bin/cucumber-chef:19:in `<main>'
The class used for the query object(config.rb:87) seems to be wrong. Maybe it needs to use Ec2AmisUbuntu?
Currently the TestLab is built using ami-339ca947 which is only available in Amazon's eu-west-1 region. I would like to propose pulling the default image a user would like to use from the .chef/knife.rb file as well using a variable like @config[:knife][image_id]
Hello, I'm starting to try chef using cucumber-chef and when executing
cucumber-chef setup I'm getting the following message
.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/net/http.rb:2105:in `error!':
404 "Not Found" (Net::HTTPServerException)
Any idea of the potential reason for this problem?
Modern versions of cucumber (and the cookbooks always install the absolute latest version) require a newer version of Rubygems than the cookbooks install. Cucumber claims to need rubygems 1.6.1 or newer. The issues stem from UTF-8 content in the gemspecs.
In the book on p34, we're told to add the following to knife.rb:
knife[:identity_file] = "/path/to/my/id_rsa-ec2"
knife[:aws_ssh_key_id] = ENV['AWS_SSH_KEY_ID']
I don't think there is any mention in the book for how to generate id_rsa-ec2
(nothing appears in a search of the PDF except page 34) nor what value $AWS_SSH_KEY_ID might be.
The only mention of SSH keys is when setting up GitHub on page 20.
Assuming I make my keys with:
ssh-keygen -t rsa -f ~/.ssh/id_rsa-ec2
What is $AWS_SSH_KEY_ID?
mlitwin@ubuntu:~$ gem install cucumber
Fetching: gherkin-2.4.1.gem (100%)
Building native extensions. This could take a while...
Fetching: term-ansicolor-1.0.5.gem (100%)
Fetching: diff-lcs-1.1.2.gem (100%)
Fetching: cucumber-1.0.0.gem (100%)
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
Thank you for installing cucumber-1.0.0.
Please be sure to read http://wiki.github.com/cucumber/cucumber/upgrading
for important information about this release. Happy cuking!
(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)
Successfully installed gherkin-2.4.1
Successfully installed term-ansicolor-1.0.5
Successfully installed diff-lcs-1.1.2
Successfully installed cucumber-1.0.0
4 gems installed
Installing ri documentation for gherkin-2.4.1...
Installing ri documentation for term-ansicolor-1.0.5...
Installing ri documentation for diff-lcs-1.1.2...
Installing ri documentation for cucumber-1.0.0...
Installing RDoc documentation for gherkin-2.4.1...
Installing RDoc documentation for term-ansicolor-1.0.5...
Installing RDoc documentation for diff-lcs-1.1.2...
Installing RDoc documentation for cucumber-1.0.0...
mlitwin@ubuntu: gem install cucumber-chef
ERROR: Error installing cucumber-chef:
cucumber-chef requires cucumber-chef (>= 0)
mlitwin@ubuntu: gem --version
1.6.2
mlitwin@ubuntu:~$ rvm --version
rvm 1.6.20 by Wayne E. Seguin ([email protected]) [https://rvm.beginrescueend.com/]
mlitwin@ubuntu:~$ ruby --version
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
mlitwin@ubuntu:~$ gem install cucumber-chef --ignore-dependencies
Successfully installed cucumber-chef-1.0.2
1 gem installed
Installing ri documentation for cucumber-chef-1.0.2...
Installing RDoc documentation for cucumber-chef-1.0.2...
When running this command:
cucumber-chef project cucumber-chef-project
I get this error:
Could not find "~/.rvm/gems/ruby-1.9.2-p180/gems/cucumber-chef-1.0.0/lib/cucumber/chef/templates/readme.erb" in any of your source paths.
Please invoke CucumberChef.source_root(PATH) with the PATH containing your templates. Currently you have no source paths.
Looks like there's a race condition in the provisioning. I got an error saying that the instance-id was not found, but when I looked in the EC2 console, there it was. I suspect that cucumber-chef issued the api call to boot the instance, and Amazon's API response was eventually consistent. cucumber-chef should retry with a timeout to find the instance data.
We have some recipes for services like Mongo that assume a 64-bit architecture. Because Chef-Cucumber hardcodes to an m1.small
type, they can't be tested without some workarounds. I'd like the ability to specify an instance type and an AMI that would work on a t1.micro
or m1.large
instance.
Using 2.0.1pre this:
cd ~/my-repo
cucumber-chef create new_project
creates "/features/new_project" not "/my-repo/features/new_project"
Any thoughts how I might have caused this behaviour?
Thanks
It seems that "veth" is a bad name for network interface type:
Chef::Exceptions::ShellCommandFailed: execute[lxc-start -d -n controller] (cucumber-chef::controller line 47) had an error: Expected process to exit with [0], but received '255'
---- Begin output of lxc-start -d -n controller ----
STDOUT:
STDERR: lxc-start: invalid network type veth^M
lxc-start: failed to process 'lxc.network.type = veth^M
'
lxc-start: failed to read configuration file
---- End output of lxc-start -d -n controller ----
Ran lxc-start -d -n controller returned 255
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell_out.rb:207:in `invalid!'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell_out.rb:193:in `error!'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/mixin/shell_out.rb:36:in `shell_out!'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/provider/execute.rb:58:in `action_run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:437:in `send'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:437:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:45:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:76:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/client.rb:312:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/client.rb:160:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/client.rb:239:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/client.rb:229:in `loop'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/client.rb:229:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application.rb:67:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/chef-client:26
/usr/bin/chef-client:19:in `load'
/usr/bin/chef-client:19
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.