-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Switch from karma to web-test-runner #704
Switch from karma to web-test-runner #704
Conversation
The nice consequence is to get the macOS webkit tests green again |
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.
Thanks for doing this maintenance work!
I left a few inline comments.
For some reason, I had to modify some tests in order for them to pass locally. Any idea what might be going on?
I was also wondering, would you mind leaving a note about how you created this pull request? Was it a lot of search/replace or were there some magic lerna commands that helped update the sub-package configs?
I'm requesting changes specifically only for one thing specifically: the missing docs for installing Playwright locally.
@@ -18,15 +18,28 @@ yarn build:src | |||
|
|||
## Tests | |||
|
|||
The tests are written using karma to simulate a browser environment. | |||
The tests are written using [web-test-runner](https://modern-web.dev/docs/test-runner/overview/) |
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.
Probably in the section above we need to add a line for how to install the Playwright browser binaries, otherwise yarn test
will not work.
We also need to specify which version of Yarn to use, because yarn playwright install
worked for me in yarn v1 and v4 but not v3.
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.
It is weird that it does not work with v3.
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.
Yeah, I wonder if what I was seeing actually had more to do with my other comment (about putting @playwright/test in the top-level package.json)
Co-authored-by: gabalafou <gabriel@fouasnon.com>
Thanks for the review @gabalafou The fact that you need to change the tests locally is surprising as they work for me locally and on the CI. Does it happens with all browsers? What is your environment? NodeJS, OS? Note for yarn, the real version used should be independent of your installed version as we include it with the repo: https://github.com/jupyterlab/lumino/tree/main/.yarn/releases Config is there: Line 3 in f26c85a
|
Yeah lots of smart search/replace... |
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.
Testing this locally some more, I think we should yarn add --dev @playwright/test
at the root level of the repo, and have users do yarn playwright install
.
Reasons:
- Correct me if I'm wrong, but at this point, Playwright is as much a dev dependency of the repo as TypeScript, so it seems like it should be there
- If users just copy paste the
yarn build:test
andyarn test
commands without reading the rest of the docs, they will get a message to runyarn playwright test
, notnpx playwright test
.
Co-authored-by: gabalafou <gabriel@fouasnon.com>
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.
Okay, this runs "out of the box" now, thank you! (By which I mean, I can do a fresh install of the repo and run the tests without getting stuck along the way.)
I'm still getting the test failures I mentioned before. I checked that this doesn't happen before this PR so I think the failures are somehow related.
I'm running Node 20.2.0 and macOS 14.4.1.
What's really bizarre is if I run each browser separately--yarn test:webkit
, yarn test:firefox
, and yarn test:chromium
--all the tests pass. It's only when I run yarn test
that I get the 9 test failures.
Do you want to open an issue and punt on this for now, since the CI is fine?
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 approving to unblock you. I'll let you decide how we want to address the tests failing on my machine :)
🎉 |
If someone else could test it to see if you have an unlucky combination of software's or not. It would be nice. Gentle ping to @JasonWeill, if you are on MacOS, would you have time to run the tests of this PR locally? For reference, I'm on Debian 12 with Node.js 20.9.0. |
Thanks a lot @gabalafou for all the tests. |
Running Lumino tests on tip-of- Main branch
fcollonval's branch
|
@JasonWeill did you run |
Sorry, I was looking at the old yarn playwright install
yarn test
|
Co-authored-by: gabalafou <gabriel@fouasnon.com>
Thanks for testing the PR @JasonWeill As the errors are reproducible, I applied the fix proposed by @gabalafou in e96e2e3. Tests are passing for me locally - so 🤞 for the CI. |
Ok as the CI is green and the fix is working locally for @gabalafou I'll merge this one. |
Fixes #610
Switch from karma to web-test-runner
I did not switch to jest to be able to test in browser directly and to not have to change the test (keep using mocha and chai).