-
Notifications
You must be signed in to change notification settings - Fork 52
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
Pushes test coverage just over 50% #18
Conversation
Travis CI is having some problems. https://www.traviscistatus.com/ Btw, I've been force pushing travis ci configs to this branch. Yell at me to stop if you need me to. |
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.
I'm too 💤 and too inexperienced with FSEvents to do a proper review, but I left a few comments. Of course I'm happy to make such minor revisions on this branch -- or even leave them for after.
Would be great if @samjacobson and/or someone else could take a look.
@@ -13,18 +14,24 @@ import ( | |||
) | |||
|
|||
func main() { | |||
dev, _ := fsevents.DeviceForPath("/tmp") | |||
path := "/tmp" |
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.
Maybe this should be os.TempDir()
?
es.Start() | ||
ec := es.Events | ||
|
||
fmt.Println("Device UUID", fsevents.GetDeviceUUID(dev)) |
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.
could just use log.Println since everything else in the file does
path := "/tmp" | ||
dev, err := fsevents.DeviceForPath(path) | ||
if err != nil { | ||
log.Println("Failed to retrieve device for path:", err) |
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.
should this be log.Fatal?
|
||
es.Events <- events | ||
} | ||
|
||
// LatestEventID returns the most recently generated event ID, system-wide. | ||
func LatestEventID() uint64 { |
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.
not everything in wrap.go is unexported, so maybe just move this function there
// You can provide your own event channel if you wish (or one will be | ||
// created on Start). | ||
// | ||
// es := &EventStream{Paths: []string{"/tmp"}, Flags: 0} |
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.
This code snippet doesn't render so well in godoc. not sure if it could be made into a (working) example? though an example need not be executed, so long as it compiles
|
||
es.stream = setupStream(paths, es.Flags, callbackInfo, since, es.Latency, es.Device) | ||
|
||
started := make(chan struct{}) |
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.
this was the addition that caused the merge conflict, see #18
|
||
// CFArrayLen retrieves the length of CFArray type | ||
// See https://developer.apple.com/library/mac/documentation/CoreFoundation/Reference/CFArrayRef/#//apple_ref/c/func/CFArrayGetCount | ||
func CFArrayLen(ref C.CFArrayRef) int { |
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.
maybe we don't want to export this?
paths := []string{"/a", "/b"} | ||
ref := setupStream(paths, 0, 0, eid, time.Duration(0), did) | ||
|
||
t.Log(GetStreamRefDescription(ref)) |
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.
not sure if we want to keep this log in the tests?
Once Travis CI is up and working again, we can force a rebuild and see if I got the config right for macOS. I'm planning to setup https://codecov.io/ as well. |
Current coverage is 43.03% (diff: 41.30%)
|
Test coverage for this branch can be viewed here: https://codecov.io/gh/fsnotify/fsevents/branch/testmock I've asked @stevepeak why the discrepancy between coverage % on codecov.io and running it on the command line. |
I'm under the gun with another project at the moment. I can take a look Cheers Sam On Fri, Oct 14, 2016 at 6:10 AM, Nathan Youngman notifications@github.com
|
Thanks Sam. That would be wonderful. |
@drewwells Do you have the time to continue working on this? |
Yeah I can look at it tomorrow |
It doesn't appear that I have push access to this PR, I'll open a PR against it then |
Sorry @drewwells. I've adjusted the settings. |
fix vet errors in fsevtCallback separate all parts that call C code into separate wrap file test registry functions test creating of paths test inspects StreamRef to ensure setupStream created it correctly
Travis CI is very slow at starting the macOS tests. We are enabled to use CircleCI now, but the yml file needs configuring. https://circleci.com/gh/fsnotify/fsevents This is what I had to do before, but it may have changed since. |
Why is codecov failing? This MR should be significantly increasing coverage from master. I can look into the circleci issue, that should probably be in a separate PR so this one doesn't get too overwhelming. |
I don't know what the deal is with codecov. Let's see what happens on the next pull request. |
@samjacobson I went ahead and merged this, but feel free to review and open PRs or issues if you see something that can be improved. Thanks! |
resolves merge conflicts in #15 from @drewwells