-
Notifications
You must be signed in to change notification settings - Fork 412
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
Add excludes capability #342
base: master
Are you sure you want to change the base?
Add excludes capability #342
Conversation
- Changed from pre-built file exclusion list in Prospect function to filepath.Match within the prospector scan function to ensure no race conditions could cause missed files
@@ -104,6 +105,18 @@ func (p *Prospector) scan(path string, output chan *FileEvent, resume *Prospecto | |||
continue | |||
} | |||
|
|||
// If the file is in the list of exclusions, skip it | |||
for _, pattern := range exclude_paths { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than exclude paths as a parameter maybe p.FileConfig here?
It saves the parameter list from growing :)
👍 Looks good I just did a tiny review to help out :) |
@driskell, thanks pointing out those small improvements that can be made. I'll fix those by tomorrow and commit the changes. |
…updated prospector scan method to directly use Exclude struct field from file config instead of creating an extra variable
code looks good. can you add tests, please? |
I take it you mean add the tests to the config_test.go file? |
Tests to verify that when it is configured to exclude files it behaves I am in my phone so I can't offer specific advice on where to put the test On Thursday, February 12, 2015, Al Lefebvre [email protected]
|
I apologize for the delay on this, I just haven't had the chance lately to work on this. I'll do my best figure out an appropriate testing mechanism and push it to this branch asap. |
@jordansissel I've created a test suite (in the "test_vm/" directory) using test kitchen along with the shell provisioner. This test seems to do the job just fine although let me know if you have any questions or comments about it. |
The directory The tests work for me. Although I need to look at Perhaps you could make their names more obvious? E.g. |
@driskell and @jordansissel do you have any feedback about the tests I created for this feature? I figured this could also potentially be used for any other tests in the future, seeing it's self contained VM that provisions itself. |
Any updates on this issue? Is there any chance you'll be merging this feature and the tests back into the master branch? |
Adding the exclude feature as requested in issue #89.