Atalanta / cucumber-chef

Framework for test-driven infrastructure development
http://cucumber-chef.org
Apache License 2.0
265 stars 55 forks source link

Problems running cucumber after cucumber-chef setup suceeded #120

Closed edyu closed 11 years ago

edyu commented 11 years ago

First it was looking for environments/*.rb files:

https://gist.github.com/edyu/5379734

And then after I created simple production.rb staging.rb and test.rb same as those in the example cc-chef-repo, I encounter network errors:

https://gist.github.com/edyu/5379745

The error on the command line is:

cucumber [~/dev/chef/chef-repo]

cucumber-chef v3.0.6 Pushing chef-repo environments to the test lab exec("/usr/bin/env knife environment from file ./environments/*.rb --user edyu --key /Users/ed/dev/chef/chef-repo/.cucumber-chef/aws/edyu.pem --server-url https://184.169.228.59 --disable-editing --yes", #<OpenStruct exit_code=0, silence=true, ui=#<ZTK::UI:0x007f93f0184210 @stdout=#<IO:>, @stderr=#IO:, @stdin=#IO:, @logger=#>, timeout=600, ignore_exit_status=false>) failed! 100 /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/ztk-1.0.10/lib/ztk/base.rb:90:in log_and_raise' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/ztk-1.0.10/lib/ztk/base.rb:129:inlog_and_raise' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/ztk-1.0.10/lib/ztk/command.rb:159:in exec' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-chef-3.0.6/lib/cucumber/chef/test_lab.rb:101:inknife_cli' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-chef-3.0.6/lib/cucumber/chef/client.rb:55:in block in up' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/ztk-1.0.10/lib/ztk/benchmark.rb:107:inblock (2 levels) in bench' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/ztk-1.0.10/lib/ztk/spinner.rb:76:in spin' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/ztk-1.0.10/lib/ztk/benchmark.rb:106:inblock in bench' /Users/ed/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/benchmark.rb:295:in realtime' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/ztk-1.0.10/lib/ztk/benchmark.rb:103:inbench' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-chef-3.0.6/lib/cucumber/chef/client.rb:54:in up' /Users/ed/dev/chef/chef-repo/features/support/cc-hooks.rb:22:in<top (required)>' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/rb_support/rb_language.rb:137:in load' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/rb_support/rb_language.rb:137:inload_code_file' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/runtime/support_code.rb:180:in load_file' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/runtime/support_code.rb:83:inblock in load_files!' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/runtime/support_code.rb:82:in each' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/runtime/support_code.rb:82:inload_files!' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/runtime.rb:182:in load_step_definitions' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/runtime.rb:41:inrun!' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/cli/main.rb:43:in execute!' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/cli/main.rb:20:inexecute' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/bin/cucumber:14:in <top (required)>' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/bin/cucumber:19:inload' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/bin/cucumber:19:in <main>' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/bin/ruby_noexec_wrapper:14:ineval' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/bin/ruby_noexec_wrapper:14:in `

'

zpatten commented 11 years ago

Looks like another issue with the aws provider, my guess is I do not open the SSL port acl. Switching over to SSL was a recent change. I'll fix this and do another patch level release when I get back home. On Apr 13, 2013 12:39 PM, "Ed Yu" notifications@github.com wrote:

First it was looking for environments/*.rb files:

https://gist.github.com/edyu/5379734

And then after I created simple production.rb staging.rb and test.rb same as those in the example cc-chef-repo, I encounter network errors:

https://gist.github.com/edyu/5379745

The error on the command line is:

cucumber [~/dev/chef/chef-repo]

cucumber-chef v3.0.6 Pushing chef-repo environments to the test lab exec("/usr/bin/env knife environment from file ./environments/*.rb --user edyu --key /Users/ed/dev/chef/chef-repo/.cucumber-chef/aws/edyu.pem --server-url https://184.169.228.59 --disable-editing --yes", #>, @stderrhttps://github.com/stderr =#IO:, @stdin https://github.com/stdin=#IO:, @loggerhttps://github.com/logger=#>, timeout=600, ignore_exit_status=false>) failed! 100 /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/ztk-1.0.10/lib/ztk/base.rb:90:in log_and_raise' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef /gems/ztk-1.0.10/lib/ztk/base.rb:129:inlog_and_raise' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/ztk-1.0.10/lib/ztk/command.rb:159:in exec' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef /gems/cucumber-chef-3.0.6/lib/cucumber/chef/test_lab.rb:101:inknife_cli' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-chef-3.0.6/lib/cucumber/chef/client.rb:55:in block in up' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef /gems/ztk-1.0.10/lib/ztk/benchmark.rb:107:inblock (2 levels) in bench' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/ztk-1.0.10/lib/ztk/spinner.rb:76:in spin' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef /gems/ztk-1.0.10/lib/ztk/benchmark.rb:106:inblock in bench' /Users/ed/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/benchmark.rb:295:in realtime' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef /gems/ztk-1.0.10/lib/ztk/benchmark.rb:103:inbench' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-chef-3.0.6/lib/cucumber/chef/client.rb:54:in up' /Users/ed/dev/chef/chef-repo/features/support/cc-hooks.rb:22:in' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/rb_support/rb_language.rb:137:in load' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef /gems/cucumber-1.2.5/lib/cucumber/rb_support/rb_language.rb:137:in load_code_file' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/runtime/support_code.rb:180:in load_file' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef /gems/cucumber-1.2.5/lib/cucumber/runtime/support_code.rb:83:inblock in load_files!' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/runtime/support_code.rb:82:in each' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef /gems/cucumber-1.2.5/lib/cucumber/runtime/support_code.rb:82:in load_files!' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/runtime.rb:182:in load_step_definitions' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef /gems/cucumber-1.2.5/lib/cucumber/runtime.rb:41:inrun!' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/lib/cucumber/cli/main.rb:43:in execute!' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef /gems/cucumber-1.2.5/lib/cucumber/cli/main.rb:20:inexecute' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/gems/cucumber-1.2.5/bin/cucumber:14:in <top (required)>' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/bin/cucumber:19:inload' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/bin/cucumber:19:in

' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/bin/ruby_noexec_wrapper:14:in eval' /Users/ed/.rvm/gems/ruby-1.9.3-p374@chef/bin/ruby_noexec_wrapper:14:in `'

— Reply to this email directly or view it on GitHubhttps://github.com/Atalanta/cucumber-chef/issues/120 .

zpatten commented 11 years ago

OK I've just pushed out v3.0.7; you should just need to either invoke cucumber, run say the status task or re-run setup. It only takes the AWS provider being instantiated to trigger the code which ensures the AWS security group is right.

I would try just firing off the status task, then re-run cucumber; additionally you can verify if the port corrects were made to the cucumber-chef AWS security group via the AWS console if you want.

Let me know if this fixes the issue.

edyu commented 11 years ago

ok, let me try. Thanks again.

zpatten commented 11 years ago

No problem; least I can do, since it appears I didn't put the AWS provider through all the paces before release. I should really be thanking you for bringing these issues to my attention so they can be fixed.

edyu commented 11 years ago

status seems to work. Having some problem with my gemset and stuff. Let me correct those first. Thanks.

zpatten commented 11 years ago

No worries!

edyu commented 11 years ago

I was doing too many "tutorials" in the same directory so I had to recreate the directory w/ only the stuff from the book to see if I can go further.

edyu commented 11 years ago

013-04-14|09:30:48.611627|76758| INFO| legendofkorea:utility.rb:268:boot|loading cucumber-chef v3.0.7 2013-04-14|09:30:48.611897|76758| INFO| legendofkorea:utility.rb:269:boot|boot(/Users/ed/dev/chef/cucumber-chef/.cucumber-chef/config.rb) 2013-04-14|09:30:50.884937|76758| INFO| legendofkorea:command.rb:71:exec|command("/usr/bin/env knife environment from file ./environments/.rb --user edyu --key /Users/ed/dev/chef/cucumber-chef/.cucumber-chef/aws/edyu.pem --server-url https://184.169.228.59 --disable-editing --yes") ========[ COMMAND ]========[ ed@ ]========[ COMMAND ]======== /usr/bin/env knife environment from file ./environments/.rb --user edyu --key /Users/ed/dev/chef/cucumber-chef/.cucumber-chef/aws/edyu.pem --server-url https://184.169.228.59 --disable-editing --yes ========[ STARTED ]========[ ed@ ]========[ STARTED ]======== ========[ STDOUT ]========[ ed@ ]========[ STDOUT ]======== Updated Environment production Updated Environment staging Updated Environment test ========[ STOPPED ]========[ ed@ ]========[ STOPPED ]======== 2013-04-14|09:30:52.601761|76758| INFO| legendofkorea:benchmark.rb:118:bench|>>> Pushing chef-repo environments to the test lab completed in 1.7194 seconds. 2013-04-14|09:30:52.622783|76758| INFO| legendofkorea:command.rb:71:exec|command("/usr/bin/env knife cookbook upload --all --cookbook-path cookbooks --force --user edyu --key /Users/ed/dev/chef/cucumber-chef/.cucumber-chef/aws/edyu.pem --server-url https://184.169.228.59 --disable-editing --yes") ========[ COMMAND ]========[ ed@ ]========[ COMMAND ]======== /usr/bin/env knife cookbook upload --all --cookbook-path cookbooks --force --user edyu --key /Users/ed/dev/chef/cucumber-chef/.cucumber-chef/aws/edyu.pem --server-url https://184.169.228.59 --disable-editing --yes ========[ STARTED ]========[ ed@ ]========[ STARTED ]======== ========[ STDERR ]========[ ed@ ]========[ STDERR ]======== ERROR: The data in your request was invalid ========[ STDOUT ]========[ ed@ ]========[ STDOUT ]======== Response: Bad checksums! ========[ STOPPED ]========[ ed@ ]========[ STOPPED ]======== 2013-04-14|09:30:53.412185|76758|FATAL| legendofkorea:command.rb:159:exec|EXCEPTION: ZTK::CommandError - "exec(\"/usr/bin/env knife cookbook upload --all --cookbook-path cookbooks --force --user edyu --key /Users/ed/dev/chef/cucumber-chef/.cucumber-chef/aws/edyu.pem --server-url https://184.169.228.59 --disable-editing --yes\", #<OpenStruct exit_code=0, silence=true, ui=#<ZTK::UI:0x007fb0404616b0 @stdout=#<IO:>, @stderr=#IO:, @stdin=#IO:, @logger=#<ZTK::Logger filename=\"/Users/ed/dev/chef/cucumber-chef/.cucumber-chef/cucumber-chef.log\">>, timeout=600, ignore_exit_status=false>) failed! [100]"

edyu commented 11 years ago

That was right after a successful "cucumber-chef setup", while I was running "cucumber".

edyu commented 11 years ago

Note I have no cookbooks yet in the directory.

edyu commented 11 years ago

Here is the command line:

cucumber [~/dev/chef/cucumber-chef]

cucumber-chef v3.0.7 Pushing chef-repo environments to the test lab completed in 1.7194 seconds. Pushing chef-repo cookbooks to the test lab exec("/usr/bin/env knife cookbook upload --all --cookbook-path cookbooks --force --user edyu --key /Users/ed/dev/chef/cucumber-chef/.cucumber-chef/aws/edyu.pem --server-url https://184.169.228.59 --disable-editing --yes", #<OpenStruct exit_code=0, silence=true, ui=#<ZTK::UI:0x007fb0404616b0 @stdout=#<IO:>, @stderr=#IO:, @stdin=#IO:, @logger=#>, timeout=600, ignore_exit_status=false>) failed! 100 /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/ztk-1.0.10/lib/ztk/base.rb:90:in log_and_raise' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/ztk-1.0.10/lib/ztk/base.rb:129:inlog_and_raise' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/ztk-1.0.10/lib/ztk/command.rb:159:in exec' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-chef-3.0.7/lib/cucumber/chef/test_lab.rb:101:inknife_cli' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-chef-3.0.7/lib/cucumber/chef/client.rb:61:in block in up' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/ztk-1.0.10/lib/ztk/benchmark.rb:107:inblock (2 levels) in bench' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/ztk-1.0.10/lib/ztk/spinner.rb:76:in spin' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/ztk-1.0.10/lib/ztk/benchmark.rb:106:inblock in bench' /Users/ed/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/benchmark.rb:295:in realtime' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/ztk-1.0.10/lib/ztk/benchmark.rb:103:inbench' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-chef-3.0.7/lib/cucumber/chef/client.rb:59:in up' /Users/ed/dev/chef/cucumber-chef/features/support/cc-hooks.rb:22:in<top (required)>' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-1.2.5/lib/cucumber/rb_support/rb_language.rb:137:in load' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-1.2.5/lib/cucumber/rb_support/rb_language.rb:137:inload_code_file' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-1.2.5/lib/cucumber/runtime/support_code.rb:180:in load_file' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-1.2.5/lib/cucumber/runtime/support_code.rb:83:inblock in load_files!' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-1.2.5/lib/cucumber/runtime/support_code.rb:82:in each' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-1.2.5/lib/cucumber/runtime/support_code.rb:82:inload_files!' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-1.2.5/lib/cucumber/runtime.rb:182:in load_step_definitions' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-1.2.5/lib/cucumber/runtime.rb:41:inrun!' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-1.2.5/lib/cucumber/cli/main.rb:43:in execute!' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-1.2.5/lib/cucumber/cli/main.rb:20:inexecute' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/gems/cucumber-1.2.5/bin/cucumber:14:in <top (required)>' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/bin/cucumber:19:inload' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/bin/cucumber:19:in <main>' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/bin/ruby_noexec_wrapper:14:ineval' /Users/ed/.rvm/gems/ruby-1.9.3-p392@chef/bin/ruby_noexec_wrapper:14:in `

'

zpatten commented 11 years ago

Ya so looks like knife is blowing up because you do not have any cookbooks. You have to have at least one cookbook for it to upload or the knife cookbook upload command will failed as it did.

zpatten commented 11 years ago

You'll need at least one role, cookbook and environment; cucumber-chef needs at least something in each category to upload to the chef-server. Currently things will fail if you do not have these requirements meant.

zpatten commented 11 years ago

Keep in mind the book was written around v1.0; we're now on v3.x

zpatten commented 11 years ago

And to be honest; the version (1.x) of the gem I ran when I first got the book did not function properly at all. Everything ended up running on the testlab and not in the containers and many other things were not working as described.

edyu commented 11 years ago

Right now, all I want to proceed further is to have cucumber-chef generate the steps file. Zachary, I'm wondering whether that part of cucumber should be allowed to run before going to aws to upload the cookbook. I'm not certain as I don't know the software enough. The primary reason I'm even checking out the book is trying to have a context to compare between puppet vs chef vs ansible from an actual user perspective. Sadly, it's the only book available atm.

zpatten commented 11 years ago

Well cucumber-chef is based around doing integration testing with chef; so there is a requirement that you have a basic, usable, chef-repo together to use it with.

You can generate a template feature via the create task if you just want to see it.

If you just want to spin up something fast; I would suggest cloning my cc-chef-repo and running cucumber-chef from that since it has all the minimum requirements meant. It has several features based around 2 of my cookbooks and a few community ones.

zpatten commented 11 years ago

I've updated the README on cc-chef-repo with step-by-step instructions: https://github.com/zpatten/cc-chef-repo/blob/master/README.md

edyu commented 11 years ago

Thanks Zachary. Created a cookbook. I'm working on Role right now.

edyu commented 11 years ago

I'll close this one since I don't want this to be the meta bug for everything I encounter. :)

zpatten commented 11 years ago

No worries; try working off the cc-chef-repo and use the online documentation. If you get stuck let me know and I can lend a hand. The book is only really good for theory at this point; Stephen is supposed to release an updated version; but I do not have any news on that unfortunately. I should note all of the of the step helpers are slightly different now and the containers are controlled via a Labfile. Most of the helper documentation is in the 2.x WIKI.md file. Not all of them work anymore; notably the provisioning ones. There are lots of examples of use of the built in step helpers in my cc-chef-repo. It uses 100% built in steps from cucumber-chef.

edyu commented 11 years ago

I'm stuck on step 5 of cc-chef-repo. I filed an issue in that repo. Thanks Zachary.