-
Notifications
You must be signed in to change notification settings - Fork 917
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
revamp triggers end-to-end functional test #2178
Conversation
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.
First pass seems totally fine to me! Esp if it still passes CI, which it looks like it does.
if (logDoneFn) { | ||
started = new Promise((resolve) => { | ||
this.process?.stdout.on("data", (data: unknown) => { | ||
if (logDoneFn(data)) { |
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 this hang forever? Shouldn't we still resolve on close
?
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 block of code tricked me the first time. If we have this function, we make this resolving promise. If we don't, we do one on 'close' below.
Basically, logDoneFn looks for a string in the data that comes through and says "started" when that happens (logDoneFn is user-supplied). If that fn isn't provided, it just waits until the process closes.
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.
Yes but what if logDoneFn(data)
never returns true
? Then the function will never hit resolve()
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.
Gotcha. After a quick discussion, we're going to reject if logDoneFn never succeeds :)
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.
Approved with one comment about logDoneFn
Description
Rewriting the triggers-end-to-end tests to be in Typescript in the new form that has been working really well in other tests.