-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(debug-log): create foundation of Roku debug log command #8
base: master
Are you sure you want to change the base?
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
caabb5f
to
24d2aa3
Compare
lib/debug-log.js
Outdated
* Resolves w/ the entire contents of the logfile | ||
*/ | ||
async getLog() { | ||
return await fs.readFile(this.logPath, 'utf8'); |
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.
the way the w3c spec is defined (we should double check), only new logs that have been written since the last request to retrieve logs should be returned. we may be better off using fs.read
and keeping track of a file pointer?
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 have an implementation for this, but working on testing to make sure everything places nice together.
I've split it up into separate classes in the name of separation-of-concerns:
RokuDebugClient
which is the telnet adapterRokuDebugWriter
which pipes aRokuDebugClient
into a logfileFileReader
which is a generic class that reads a file piecemeal
If the cap is enabled, the driver will instantiate a RokuDebugWriter
and a FileReader
; whenever the "get log" command happens, FileReader#read()
is called and the contents of the logfile from last read to EOF are returned
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.
update: I've written unit tests. next is E2E tests. I expect to acquire a device soon which should make things easier. I will probably want to create a sample app too
9cd3989
to
dade095
Compare
24d2aa3
to
0def513
Compare
9846a9a
to
b4c992d
Compare
@jlipps what if the minimum node version was 16? 😜 |
beeeb31
to
3c0dc94
Compare
A Roku device has a debug log which is accessible via telnet. We can use this to provide data via the WD `/session/:sessionId/log` route. What's here so far is an implementation of a thing which just listens on an arbitrary telnet server and pipes its output to a file, since that's probably unwise to keep in memory. When the command is issued, the driver can send the contents of the file to the client (and probably truncate it?). This depends on type changes not yet published in Appium and will fail CI. Note: The reason for two separate Telnet libs is that one provides a server & client and another only provides a client, but the client in the former is broken and I couldn't find another decent module which creates a dummy telnet server for testing. - added wallaby config - replace `chai` with `unexpected`
- add default connect timeout - do not connect when already connected - move setEncoding call (may be wrong)
c2f8623
to
5d400a0
Compare
A Roku device has a debug log which is accessible via telnet. We can use this to provide data via the WD
/session/:sessionId/log
route.What's here so far is an implementation of a thing which just listens on an arbitrary telnet server and pipes its output to a file, since that's probably unwise to keep in memory. When the command is issued, the driver can send the contents of the file to the client (and probably truncate it?).
This depends on type changes not yet published in Appium and will fail CI.
Note: The reason for two separate Telnet libs is that one provides a server & client and another only provides a client, but the client in the former is broken and I couldn't find another decent module which creates a dummy telnet server for testing.
UPDATE: This depends on appium/appium#17640