Skip to content

Instantly share code, notes, and snippets.

@hosh
Created April 8, 2014 21:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hosh/10196317 to your computer and use it in GitHub Desktop.
Save hosh/10196317 to your computer and use it in GitHub Desktop.
Failures:
1) Search API endpoint /search/node POST targeted toward many nodes with body of {"possibly_nested"=>["top", "middle", "bottom"], "the_name"=>["name"], "not_found"=>["foo", "bar", "baz", "totally_not
_a_real_field"], "empty"=>[]} should succeed, and return multiple nodes
Failure/Error: r.should look_like search_success_response
Expected a full match of the result
{"total"=>4,
"start"=>0,
"rows"=>
[{"url"=>
"https://chef-server:443/nodes/pedant_multiple_node_1396924340-372484258-2593_1",
"data"=>
{"possibly_nested"=>nil,
"the_name"=>"pedant_multiple_node_1396924340-372484258-2593_1",
"not_found"=>nil,
"empty"=>nil}},
{"url"=>
"https://chef-server:443/nodes/pedant_multiple_node_1396924340-372484258-2593_2",
"data"=>
{"possibly_nested"=>nil,
"the_name"=>"pedant_multiple_node_1396924340-372484258-2593_2",
"not_found"=>nil,
"empty"=>nil}},
{"url"=>
"https://chef-server:443/nodes/pedant_multiple_node_1396924340-372484258-2593_4",
"data"=>
{"possibly_nested"=>nil,
"the_name"=>"pedant_multiple_node_1396924340-372484258-2593_4",
"not_found"=>nil,
"empty"=>nil}}]}
to the spec
{"total"=>6,
"start"=>0,
"rows"=>
[{"url"=>"https://chef-server:443/nodes/pedant_node_test",
"data"=>
{"possibly_nested"=>"found_it",
"the_name"=>"pedant_node_test",
"not_found"=>nil,
"empty"=>nil}},
{"url"=>
"https://chef-server:443/nodes/pedant_multiple_node_1396924340-372484258-2593_1",
"data"=>
{"possibly_nested"=>nil,
"the_name"=>"pedant_multiple_node_1396924340-372484258-2593_1",
"not_found"=>nil,
"empty"=>nil}},
{"url"=>
"https://chef-server:443/nodes/pedant_multiple_node_1396924340-372484258-2593_2",
"data"=>
{"possibly_nested"=>nil,
"the_name"=>"pedant_multiple_node_1396924340-372484258-2593_2",
"not_found"=>nil,
"empty"=>nil}},
{"url"=>
"https://chef-server:443/nodes/pedant_multiple_node_1396924340-372484258-2593_3",
"data"=>
{"possibly_nested"=>nil,
"the_name"=>"pedant_multiple_node_1396924340-372484258-2593_3",
"not_found"=>nil,
"empty"=>nil}},
{"url"=>
"https://chef-server:443/nodes/pedant_multiple_node_1396924340-372484258-2593_4",
"data"=>
{"possibly_nested"=>nil,
"the_name"=>"pedant_multiple_node_1396924340-372484258-2593_4",
"not_found"=>nil,
"empty"=>nil}},
{"url"=>
"https://chef-server:443/nodes/pedant_multiple_node_1396924340-372484258-2593_5",
"data"=>
{"possibly_nested"=>nil,
"the_name"=>"pedant_multiple_node_1396924340-372484258-2593_5",
"not_found"=>nil,
"empty"=>nil}}]}
2) Search API endpoint /search/<data_bag> Search tokenizer When the Chef server has data bag items with "foo" and "foo-bar" A search for foo* AND NOT bar returns foo and foo-bar
Failure/Error: search('x', 'id:foo* AND NOT bar').map { |row| row['name'] }.should =~ [ 'data_bag_item_x_foo', 'data_bag_item_x_foo-bar' ]
expected: 0
got: 1 (using ==)
# ./lib/pedant/rspec/search_util.rb:709:in `block in search'
# ./lib/pedant/rspec/search_util.rb:671:in `with_search_polling'
# ./lib/pedant/rspec/search_util.rb:705:in `search'
# ./spec/api/search/search_spec.rb:483:in `block (5 levels) in <top (required)>'
Finished in 20 minutes 15.56 seconds
2746 examples, 2 failures, 30 pending
This is from the upgrade test, from latest:
1) Search API endpoint /search/node GET with a run_list of ["recipe[pedant_testing_cookbook@1.0.0]"] searching for recipe:pedant_testing_cookbook@1.0.0 (properly escaped) should return the node,
Failure/Error: r.should look_like search_success_response
Expected a full match of the result
{"total"=>2,
"start"=>0,
"rows"=>
[{"name"=>"pedant_node_test",
"json_class"=>"Chef::Node",
"chef_type"=>"node",
"chef_environment"=>"_default",
"override"=>{},
"normal"=>{},
"default"=>{},
"automatic"=>{},
"run_list"=>["recipe[pedant_testing_cookbook@1.0.0]"]}]}
to the spec
{"total"=>1,
"start"=>0,
"rows"=>
[{"name"=>"pedant_node_test",
"json_class"=>"Chef::Node",
"chef_type"=>"node",
"chef_environment"=>"_default",
"override"=>{},
"normal"=>{},
"default"=>{},
"automatic"=>{},
"run_list"=>["recipe[pedant_testing_cookbook@1.0.0]"]}]}
to succeed, but it didn't!
# ./lib/pedant/rspec/search_util.rb:100:in `block (2 levels) in performing_a_search'
# ./lib/pedant/rspec/search_util.rb:671:in `with_search_polling'
# ./lib/pedant/rspec/search_util.rb:87:in `block in performing_a_search'
2) Search API endpoint /search/node POST searching a node with [:override, :automatic] attributes, with a partial search path of ["testing"] should return {"three"=>"override", "four"=>"automatic"}, showing 'override' < 'automatic' attributes
Failure/Error: r.should look_like search_success_response
Expected a full match of the result
{"total"=>0, "start"=>0, "rows"=>[]}
to the spec
{"total"=>1,
"start"=>0,
"rows"=>
[{"url"=>"https://chef-server:443/nodes/pedant_node_test",
"data"=>{"target"=>{"three"=>"override", "four"=>"automatic"}}}]}
to succeed, but it didn't!
# ./lib/pedant/rspec/search_util.rb:100:in `block (2 levels) in performing_a_search'
# ./lib/pedant/rspec/search_util.rb:671:in `with_search_polling'
# ./lib/pedant/rspec/search_util.rb:87:in `block in performing_a_search'
Finished in 20 minutes 46.85 seconds
2746 examples, 2 failures, 30 pending
Another try at install:
Failures:
1) Search API endpoint /search/node GET with a run_list of ["recipe[pedant_testing_cookbook]"] searching for run_list:recipe[pedant_testing_cookbook] (properly escaped) should return the node,
Failure/Error: r.should look_like search_success_response
Expected a full match of the result
{"total"=>2,
"start"=>0,
"rows"=>
[{"name"=>"pedant_node_test",
"json_class"=>"Chef::Node",
"chef_type"=>"node",
"chef_environment"=>"_default",
"override"=>{},
"normal"=>{},
"default"=>{},
"automatic"=>{},
"run_list"=>["recipe[pedant_testing_cookbook]"]}]}
to the spec
{"total"=>1,
"start"=>0,
"rows"=>
[{"name"=>"pedant_node_test",
"json_class"=>"Chef::Node",
"chef_type"=>"node",
"chef_environment"=>"_default",
"override"=>{},
"normal"=>{},
"default"=>{},
"automatic"=>{},
"run_list"=>["recipe[pedant_testing_cookbook]"]}]}
to succeed, but it didn't!
# ./lib/pedant/rspec/search_util.rb:100:in `block (2 levels) in performing_a_search'
# ./lib/pedant/rspec/search_util.rb:671:in `with_search_polling'
# ./lib/pedant/rspec/search_util.rb:87:in `block in performing_a_search'
2) Search API endpoint /search/<data_bag> Search tokenizer When the Chef server has data bag items with "foo" and "foo-bar" A search for foo-bar returns foo-bar and nothing else
Failure/Error: search('x', 'id:foo-bar').map { |row| row['name'] }.should =~ [ 'data_bag_item_x_foo-bar' ]
expected collection contained: ["data_bag_item_x_foo-bar"]
actual collection contained: []
the missing elements were: ["data_bag_item_x_foo-bar"]
# ./spec/api/search/search_spec.rb:479:in `block (5 levels) in <top (required)>'
3) Search API endpoint partial search roles nodes returns partial results from default attributes of a node
Failure/Error: response.should look_like({:status => 200,
Expected a partial match of the result
{"total"=>0, "start"=>0, "rows"=>[]}
to the spec
{"total"=>1,
"rows"=>
[{"url"=>
"https://chef-server:443/nodes/pedant-search-target-node-1396991989-76995678-2620",
"data"=>{"we_found_default"=>true}}]}
to succeed, but it didn't!
# ./spec/api/search/search_spec.rb:650:in `block (7 levels) in <top (required)>'
# ./lib/pedant/request.rb:112:in `authenticated_request'
# ./lib/pedant/request.rb:129:in `post'
# ./spec/api/search/search_spec.rb:648:in `block (6 levels) in <top (required)>'
# ./lib/pedant/rspec/search_util.rb:671:in `with_search_polling'
# ./spec/api/search/search_spec.rb:644:in `block (5 levels) in <top (required)>'
Finished in 22 minutes 4.05 seconds
2746 examples, 3 failures, 30 pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment