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

(PDK-997) Remove Dir.chdir call from check:test_file task #266

Merged
merged 1 commit into from
Dec 8, 2018

Conversation

rodjek
Copy link
Contributor

@rodjek rodjek commented Dec 6, 2018

This chdir breaks the isolation of the rake task and affects the
behaviour of other tasks that are invoked in it in the same rake
execution.

Rather than modify the task so that it changes back to the parent
directory after the task has finished, we can just remove the chdir
entirely and just change the glob to look for files in the directory.

This PR also adds some basic unit tests for the check:test_file task.

@codecov-io
Copy link

codecov-io commented Dec 6, 2018

Codecov Report

Merging #266 into master will increase coverage by 0.63%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #266      +/-   ##
==========================================
+ Coverage   40.97%   41.61%   +0.63%     
==========================================
  Files          10       10              
  Lines         759      757       -2     
==========================================
+ Hits          311      315       +4     
+ Misses        448      442       -6
Impacted Files Coverage Δ
lib/puppetlabs_spec_helper/rake_tasks.rb 43.84% <100%> (+2.37%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 879ce61...4a85db6. Read the comment docs.

This `chdir` breaks the isolation of the rake task and affects the
behaviour of other tasks that are invoked in it in the same `rake`
execution.

Rather than modify the task so that it changes back to the parent
directory after the task has finished, we can just remove the `chdir`
entirely and just change the glob to look for files in the directory.

This PR also adds some basic unit tests for the `check:test_file` task.
@puppetcla
Copy link

CLA signed by all contributors.

@nkanderson
Copy link

@rodjek This seems like a sensible change to me. It's admittedly my first interaction with this codebase though, so feel free to pull in another reviewer if you'd like to get any additional eyes on it.

@nkanderson nkanderson self-requested a review December 7, 2018 23:34
@rodjek rodjek merged commit 133d4ac into puppetlabs:master Dec 8, 2018
@rodjek rodjek deleted the pdk-997 branch December 8, 2018 00:49
@pmcmaw pmcmaw added the bug label Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants