microsoft / playwright-dotnet

.NET version of the Playwright testing and automation library.
https://playwright.dev/dotnet/
MIT License
2.47k stars 235 forks source link

Permissions issues on the bundled playwright + node driver wrappers #1524

Closed baronfel closed 3 years ago

baronfel commented 3 years ago

I was experimenting with 1.12.1 today and found that on my macos machine, on .net sdk 5.0.300, I couldn't actually run my newly-written tests because the binaries that were copied to my projects' output directory had invalid permissions.

Here's the extracted layout from my nuget cache:

.rw-r--r-- 81k chethusk  8 Jun 21:01 /Users/chethusk/.nuget/packages/microsoft.playwright/1.12.1/Drivers/node/LICENSE

/Users/chethusk/.nuget/packages/microsoft.playwright/1.12.1/Drivers/node/linux:
.rw-r--r-- 48M chethusk  8 Jun 21:01 node
.rw-r--r-- 122 chethusk  9 Jun  2:09 playwright.sh

/Users/chethusk/.nuget/packages/microsoft.playwright/1.12.1/Drivers/node/mac:
.rw-r--r-- 47M chethusk  8 Jun 21:01 node
.rw-r--r-- 122 chethusk  9 Jun  2:09 playwright.sh

/Users/chethusk/.nuget/packages/microsoft.playwright/1.12.1/Drivers/node/win32:
.rw-r--r-- 25M chethusk  8 Jun 21:02 node.exe
.rw-r--r--  79 chethusk  9 Jun  2:09 playwright.cmd

/Users/chethusk/.nuget/packages/microsoft.playwright/1.12.1/Drivers/node/win32_x64:
.rw-r--r-- 30M chethusk  8 Jun 21:02 node.exe
.rw-r--r--  79 chethusk  9 Jun  2:09 playwright.cmd

as a result, when they copy over the playwright transport can't be created because the Process.Start command fails due to permissions errors.

I've worked around this locally with a build step that chowns things, but it is mildly annoying.

pavelfeldman commented 3 years ago

I was developing 1.12.1 on a Mac as a primary device and never had this issue. Could you repeat the steps from https://playwright.dev/dotnet/docs/intro#first-project and tell us if it worked for you?

baronfel commented 3 years ago

I did a quick test based on some intuition I had: I used paket to manage my dependencies in this project instead of 'raw' Nuget, but when I cleared my global nuget cache and redownloaded the package via Nuget (in this case through F# Interactive for a quick repro loop) I found that nuget had in fact maintained the correct permissions on the extracted packages' files. I'll log an issue in Paket, and this can be closed.