-
Notifications
You must be signed in to change notification settings - Fork 12
Add regression test for VideoManager heartbeat crash
#84
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
Conversation
The assertions are self explanatory and this makes the code cleaner while also removing the chance that the error messages will be out of sync with the expectation contents.
657e2cd to
a704373
Compare
| ) | ||
| parselyTracker.track.event(event: event) | ||
| os_log("Sent vheartbeat for video %s", log: OSLog.tracker, type:.debug, data.key) | ||
| curVideo._heartbeatsSent += 1 |
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 mutation is why we need curVideo to be a var.
| // ...and verify that no crash has occurred by performing a simple assertion on the tracker state | ||
| expect(self.parselyTestTracker.eventQueue.list).to(beEmpty()) |
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 didn't write it in the comment (can add it if you think it would be useful) but of course if there's a crash this code won't run. The assertion is there just so that we can have something in the test.
Tests/VideoTests.swift
Outdated
| "A call to trackPause should not remove an accumulator from videoManager.accumulators") | ||
| let videoManager = VideoManager(trackerInstance: parselyTestTracker) | ||
|
|
||
| videoManager.trackPlay( |
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 line doesn't have the right indentation. Move one more level to the right?
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.
π€¦ββοΈ there's something clashing between my VS Code and .vimrc and it's breaking formatting π
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 builds on top of the work done by @HelioMesquita in #83. Many thanks! πββοΈ