-
Notifications
You must be signed in to change notification settings - Fork 235
Fix not being able to run tests on Electron in Ubuntu 24.04 pipelines #8914
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
base: master
Are you sure you want to change the base?
Changes from all commits
145571b
4017514
0621976
f975fa5
16ef34b
1d9f7fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,18 @@ steps: | |
| node ./common/scripts/install-run-rush webpack:test -v | ||
| displayName: "Rush build" | ||
|
|
||
| - script: | | ||
| SANDBOX_PATH=$(find $PWD/common/temp/node_modules/.pnpm -path "*/electron@*/node_modules/electron/dist/chrome-sandbox" 2>/dev/null | head -n 1) | ||
| if [ -f "$SANDBOX_PATH" ]; then | ||
| sudo chown root:root "$SANDBOX_PATH" | ||
| sudo chmod 4755 "$SANDBOX_PATH" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think running
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (But I guess it's possible that I'm missing something, and
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This may be a safer fix: https://gist.github.com/0xdeadbad/5ef3a38c8cf6efc264d9a6f11f50e5b8
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: the fix fix above is for a different program, but I think it can be adapted to work with Electron/
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, the following command probably fixes the problem without giving root privileges to the I believe that this puts the security back to the way it was before 24.04. That's definitely not ideal, but may be better than the current fix. Changing the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a comment about what this chmod enables? This is setting execute (5 - read+execute) for all users, correct?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it is decided to leave this, then a comment explaining what it does and why it is acceptable is definitely required. The 4 at the beginning means that |
||
| echo "Fixed permissions for $SANDBOX_PATH" | ||
| else | ||
| echo "##vso[task.logissue type=warning]Unable to configure chrome-sandbox permissions" | ||
GytisCepk marked this conversation as resolved.
Show resolved
Hide resolved
GytisCepk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| fi | ||
| displayName: "Fix Electron chrome-sandbox Permissions" | ||
| condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Linux')) | ||
|
|
||
| - script: npm run test:integration | ||
| workingDirectory: "full-stack-tests/backend" | ||
| env: | ||
|
|
||
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.
Are we sure we want to swap to latest and not a fixed 24.x? What if latest breaks us again in the future