Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't mask directory deletion errors #4991

Merged
merged 1 commit into from
Jun 6, 2016
Merged

Conversation

jaymzh
Copy link
Collaborator

@jaymzh jaymzh commented Jun 3, 2016

closes #4988

@jaymzh
Copy link
Collaborator Author

jaymzh commented Jun 3, 2016

CC @chef/client-core

@lamont-granquist
Copy link
Contributor

yeah, that makes sense 👍

@thommay
Copy link
Contributor

thommay commented Jun 3, 2016

seems good 👍

@btm
Copy link
Contributor

btm commented Jun 3, 2016

Can you add a regression unit test to make sure we don't revert back and fix the existing copy-pasta on line 230 of the unit test while you're in there?

  describe "#run_action(:create)" do
    describe "when the directory exists" do
      it "deletes the directory" do
        directory.run_action(:delete)
        expect(File.exist?(tmp_dir)).to be false
      end

@jaymzh
Copy link
Collaborator Author

jaymzh commented Jun 3, 2016

The typo is easy - but I have no idea how to write a test to simulate the OS failing the delete... :(

@btm
Copy link
Contributor

btm commented Jun 3, 2016

being a unit test I was just thinking something like

it "does not use rm_rf which silently consumes errors" do
  expect(FileUtils).not_to receive(:rm_rf)
end

@jaymzh
Copy link
Collaborator Author

jaymzh commented Jun 6, 2016

Oh. I can do that. sure :)

@jaymzh
Copy link
Collaborator Author

jaymzh commented Jun 6, 2016

Tests fixed/added.

@btm
Copy link
Contributor

btm commented Jun 6, 2016

👍 on green

@smurawski
Copy link
Contributor

smurawski commented Jun 6, 2016

The appveyor build failure is not related - I looks like the appveyor build images just got a newer version of powershell which requires a different key usage type for the cert for password decryption.

Appveyor added PowerShell 5 to the base worker image on June 5. appveyor/ci#778

@jaymzh
Copy link
Collaborator Author

jaymzh commented Jun 6, 2016

green on travis. av is unrelated. Merging.

@jaymzh jaymzh merged commit 45419b1 into chef:master Jun 6, 2016
@mwrock mwrock added the Bug label Jul 1, 2016
@thommay thommay added Type: Bug Does not work as expected. and removed Bug labels Jan 25, 2017
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Does not work as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recursive directory failure ignores failure
6 participants