-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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.
It's great having you contribute to this project
Welcome to the community 🤓If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our Discord chat and our GitHub Organisation - we help and encourage each other to contribute to open source little and often 🤓 . Any questions let us know.
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.
Thank you 👍
.gitpod.yml
Outdated
- name: Install npm dependencies | ||
init: | | ||
npm ci | ||
npx playwright install --with-deps chromium |
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 didn't work for me, I still needed to run this command manually to make the test pass 🤔
I wonder why this command doesn't run correctly when building the project on GitHub
The scripts need to be executed in a custom-dockerfile. |
Would the playwright install be the only command needed in the dockerfile or would the |
How do we do it for the |
I think I have it working now. I was able to install the OS level browser dependencies in the Dockerfile. |
.gitpod.yml
Outdated
command: | | ||
npx playwright install chromium |
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.
When running this command in the dockerfile, we shouldn't need it here
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 command in the Dockerfile is install-deps
, which performs an apt-get
for all the packages required for chromium to run on the OS. Since this uses an OS level package installer it works fine.
The command in .gitpod.yml
only installs the chromium browser. This seems to be done in user space but not in the workspace directory that will get persisted. Thus the need to run it in the command section.
I wish there was a better way to do this. The Playwright docs are a bit light on how their browser install tooling actually works. If there was a way to install chromium at the OS level that would work with Playwright that would be the best solution.
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.
Oh I see 👀
An assumption from my side - I didn't test it. Could we potentially run npx playwright install --with-deps chromium
in the dockerfile and it takes care of all?
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 checked and Playwright installs chromium in /home/gitpod/.cache/ms-playwright/chromium-1028/chrome-linux
on gitpod.
Should this directory be persisted through the whole container build process?
I tried the install with deps in a previous commit but it didn't work.
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 found a way to install chromium in node_modules
via the Playwright docs.
I updated the .gitpod.yml
to do this in the init section.
Thank you both for continuing to work through this 💪 I know it will help many people 👍 |
It works 🎉 gitpod /workspace/LinkFree (gitpod) $ npm run test
> linkfree@1.9.0 test
> npx playwright test
Running 19 tests using 1 worker
[WebServer] (node:1331) [DEP0128] DeprecationWarning: Invalid 'main' field in '/workspace/LinkFree/node_modules/react-icons/package.json' of 'lib'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
[WebServer] Warning: data for page "/search" (path "/search?username=_test-profile-does-not-exist") is 492 kB which exceeds the threshold of 128 kB, this amount of data can reduce performance.
See more info here: https://nextjs.org/docs/messages/large-page-data
[WebServer] Warning: data for page "/search" is 492 kB which exceeds the threshold of 128 kB, this amount of data can reduce performance.
See more info here: https://nextjs.org/docs/messages/large-page-data
[19/19] [chromium] › search.spec.js:44:6 › find the profile after providing concise name
10 skipped
9 passed (43s)
To open last HTML report run:
npx playwright show-report |
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.
wow great work Dan 🔥
Thanks @Cahllagerfeld for supporting with this 👍
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.
Looks great! Thanks. 🚀
Fixes Issue
Closes #2257
Changes proposed
Install playwright dependencies on init.
Set Playwright to not run parallel tests on Gitpod
Check List (Check all the applicable boxes)