{"action":"closed","issue":{"url":"https://api.github.com/repos/sethvargo/chefspec/issues/565","labels_url":"https://api.github.com/repos/sethvargo/chefspec/issues/565/labels{/name}","comments_url":"https://api.github.com/repos/sethvargo/chefspec/issues/565/comments","events_url":"https://api.github.com/repos/sethvargo/chefspec/issues/565/events","html_url":"https://github.com/sethvargo/chefspec/issues/565","id":58377028,"number":565,"title":"Generating coverage report changes exit status of rspec command.","user":{"login":"darklore","id":958690,"avatar_url":"https://avatars.githubusercontent.com/u/958690?v=3","gravatar_id":"","url":"https://api.github.com/users/darklore","html_url":"https://github.com/darklore","followers_url":"https://api.github.com/users/darklore/followers","following_url":"https://api.github.com/users/darklore/following{/other_user}","gists_url":"https://api.github.com/users/darklore/gists{/gist_id}","starred_url":"https://api.github.com/users/darklore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darklore/subscriptions","organizations_url":"https://api.github.com/users/darklore/orgs","repos_url":"https://api.github.com/users/darklore/repos","events_url":"https://api.github.com/users/darklore/events{/privacy}","received_events_url":"https://api.github.com/users/darklore/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-20T16:37:47Z","updated_at":"2015-02-27T16:28:33Z","closed_at":"2015-02-27T16:28:33Z","body":"I've found that exit status code is 0 if generating coverage report though there is some failures in spec.\r\n\r\nChefDK 0.4.0\r\nchefspec 4.2.0\r\n\r\nReproduce procedure:\r\nPrepare these files.\r\nspec_helper\r\n```ruby\r\nrequire 'chefspec'\r\nrequire 'chefspec/berkshelf'\r\n\r\nChefSpec::Coverage.start!\r\n```\r\n\r\ndefault_spec.rb\r\n```ruby\r\nrequire 'spec_helper'\r\ndescribe 'test::default' do\r\n  it 'should raise error' do\r\n    expect{ChefSpec::ServerRunner.new.converge described_recipe}.to raise_error\r\n  end\r\nend\r\n```\r\n\r\nrecipes/default.rb\r\n```\r\n(empty file)\r\n```\r\n\r\nAnd then run ```chef exec rspec```.\r\nIt reports 1 failure but exit status code is 0.\r\n\r\n```\r\n$ chef exec rspec\r\nF\r\n\r\nFailures:\r\n\r\n  1) test::default converges successfully\r\n     Failure/Error: expect{ChefSpec::ServerRunner.new.converge described_recipe}.to raise_error\r\n       expected Exception but nothing was raised\r\n     # ./spec/unit/recipes/default_spec.rb:12:in `block (2 levels) in <top (required)>'\r\n\r\nFinished in 0.22133 seconds (files took 2.84 seconds to load)\r\n1 example, 1 failure\r\n\r\nFailed examples:\r\n\r\nrspec ./spec/unit/recipes/default_spec.rb:11 # test::default converges successfully\r\n\r\n  No Chef resources found, skipping coverage calculation...\r\n\r\n$ echo $?\r\n0\r\n```\r\n\r\nIf remove ```ChefSpec::Coverage.start!``` from spec_helper.rb, the status code is 1.\r\n\r\nIs it expected behavior that ```ChefSpec::Coverage.start!``` changes the exit status code to 0 though there is any failure in rspec run?"}}