[chef] Re: Re: Re: "knife cookbook site install" fails. Knife or Git issue?


Chronological Thread 
  • From: Akzhan Abdulin < >
  • To:
  • Subject: [chef] Re: Re: Re: "knife cookbook site install" fails. Knife or Git issue?
  • Date: Fri, 6 May 2011 18:14:54 +0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qsoj9xTvDYS/xr9e1H7Ngh3nXzaqAJ1H1tSvWAhh1s4W1bPRDccb29UKF61o6sWTnC lqpOybN+2SWuuytP86PPDrv4u0GSSwSP0ZjNbSZ/PePmR/SUQ5w6/wbE447QwfhdZ5iQ nZvqo7j6scgOI26N3/zWA2+cAbLzwqoFJTSGQ=

Now failure notice in master branch looks like:

expected branch_exists?("chef-vendor-absent") to return false, got true


2011/5/6 Akzhan Abdulin < "> >
By the way, a lot of tests written in fair manner with tests of "is_boolean_function?.should be_true/false". These tests write very noniformative failure notices when spec failed.

I have rewritten spec for CHEF-2314 using "should/should_not be_boolean_function". This syntax provides more informative failure notices.


2011/5/6 Akzhan Abdulin < " target="_blank"> >
There I have added branch 'chef-vendor-absent-new'

And try to look for branch chef-vendor-absent. branch_exists? returns wrong true value.

2011/5/6 Akzhan Abdulin < " target="_blank"> >
I have fixed server code and add spec for it. In original master branch this spec is failed.

Mac-mini-Akzhan-Abdulin:chef akzhanabdulin$ spec spec/unit/knife/core/cookbook_scm_repo_spec.rb
....F...........

1)
'Chef::Knife::CookbookSCMRepo determines if a the branch not exists correctly without substring search' FAILED
expected true to be false
./spec/unit/knife/core/cookbook_scm_repo_spec.rb:122:

Finished in 0.015377 seconds

16 examples, 1 failure


2011/5/6 Mark J. Reed < " target="_blank"> >

I don't have the Chef server code in front of me, but are you sure it's calling include? on the individual strings rather than the whole list?The latter would seem to make more sense in this instance.  

["chef-vendor-rabbitmq_chef"].include?("chef-vendor-rabbitmq") => false

On Fri, May 6, 2011 at 9:12 AM, Ringo De Smet < " target="_blank"> > wrote:
Gents,

This is a bug in Chef, more specifically in CookbookSCMRepo.branch_exists?

In my case, I already had branch chef-vendor-rabbitmq_chef in my repo,
but now I wanted to add branch chef-vendor-rabbitmq. The
implementation checks the list of existing branches and matches using
the String.include? method, however:

"chef-vendor-rabbitmq_chef".include?("chef-vendor-rabbitmq")  => true

Filed this ticket: CHEF-2314

Ringo



--
Mark J. Reed < " target="_blank"> >








Archive powered by MHonArc 2.6.16.

§