-
Notifications
You must be signed in to change notification settings - Fork 6
test: Use yarn ocap for e2e tests #268
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
eb712d8 to
d19a668
Compare
b40a7d6 to
ed546ba
Compare
ed546ba to
5371e83
Compare
packages/extension/package.json
Outdated
| "test:verbose": "yarn test --reporter verbose", | ||
| "test:watch": "vitest --config vitest.config.ts", | ||
| "test:e2e": "playwright test", | ||
| "test:e2e": "yarn start:server & playwright test", |
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.
But does the server close when the tests end? Was there an issue with playwrights webServer option?
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.
Ah I saw the hangup, not ideal tbh
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, the issue was playwright not noticing ocap serve is up when using the webServer command and just hanging waiting for it to start listening. I tried to notify of listening by sending 200 on empty / ping request but without success; so it seems to me playwright is not querying the server to find out if it's up but just waiting for the launch process to exit. the issue is the start:server command never returns control to playwright, and I would need to write a background process w/ disk state to do so. instead I opted to just run in a different shell process and auto hangup
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.
#226 asks about a daemon the cli can start / stop; given some time to implement a daemon, a stateful server would be an easy add-on. Then I could make the ocap serve command exit once the server is up instead of holding open while the server is running. In the mean time... 'not ideal' beats 'not implemented' 🙃
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.
We should remove the hangup options (and withTimeout etc.) and just do this instead: #270
To the extent that we can avoid relying on wall clock timers, we should do so.
Refactors the e2e test invocation to avoid a timed hangup of the server. We still start the server in parallel with Playwright, but we always close the server by killing its process after the tests end.
rekmarks
left a comment
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.
LGTM!
Changes
@ocap/extensiontest-e2e-ci.shshell script.ocap bundleandocap serveto setup the e2e tests.