Skip to content
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

chore(ci): fast playwright install #3543

Merged
merged 11 commits into from
Dec 11, 2024
Merged

chore(ci): fast playwright install #3543

merged 11 commits into from
Dec 11, 2024

Conversation

jasonkuhrt
Copy link
Collaborator

@jasonkuhrt jasonkuhrt commented Dec 11, 2024

This PR improves Playwright install times on CI down to ~4 seconds (on cache hit).

It addresses: #3540 (comment)

It also brings refactoring benefits:

  1. Workspace level installation of Playwright. One version to rule them all in the monorepo.
  2. I expect the omission of post install hooks for installing browser binaries (we had that for puppeteer too) to make this solution faster than when we were using Puppeteer.

Closes #3544

Copy link

changeset-bot bot commented Dec 11, 2024

⚠️ No Changeset found

Latest commit: 07645c2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Dec 11, 2024

Apollo Federation Subgraph Compatibility Results

Federation 1 Support Federation 2 Support
_service🟢
@key (single)🟢
@key (multi)🟢
@key (composite)🟢
repeatable @key🟢
@requires🟢
@provides🟢
federated tracing🟢
@link🟢
@shareable🟢
@tag🟢
@override🟢
@inaccessible🟢
@composeDirective🟢
@interfaceObject🟢

Learn more:

Copy link
Contributor

github-actions bot commented Dec 11, 2024

✅ Benchmark Results

     ✓ no_errors{mode:graphql}
     ✓ expected_result{mode:graphql}
     ✓ no_errors{mode:graphql-jit}
     ✓ expected_result{mode:graphql-jit}
     ✓ no_errors{mode:graphql-response-cache}
     ✓ expected_result{mode:graphql-response-cache}
     ✓ no_errors{mode:graphql-no-parse-validate-cache}
     ✓ expected_result{mode:graphql-no-parse-validate-cache}
     ✓ no_errors{mode:uws}
     ✓ expected_result{mode:uws}

     checks.......................................: 100.00% ✓ 512592      ✗ 0     
     data_received................................: 2.1 GB  14 MB/s
     data_sent....................................: 103 MB  687 kB/s
     http_req_blocked.............................: avg=1.55µs   min=1.04µs   med=1.35µs   max=286.43µs p(90)=2.03µs   p(95)=2.22µs  
     http_req_connecting..........................: avg=2ns      min=0s       med=0s       max=138.96µs p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=365.4µs  min=221.2µs  med=331.66µs max=18.32ms  p(90)=476.6µs  p(95)=502.4µs 
       { expected_response:true }.................: avg=365.4µs  min=221.2µs  med=331.66µs max=18.32ms  p(90)=476.6µs  p(95)=502.4µs 
     ✓ { mode:graphql-jit }.......................: avg=294.34µs min=221.2µs  med=275.96µs max=18.32ms  p(90)=309.72µs p(95)=327.84µs
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=502.96µs min=414.09µs med=478.21µs max=6.15ms   p(90)=530.5µs  p(95)=581.2µs 
     ✓ { mode:graphql-response-cache }............: avg=345.7µs  min=267.35µs med=328.44µs max=6.57ms   p(90)=359.73µs p(95)=371.39µs
     ✓ { mode:graphql }...........................: avg=373.8µs  min=282.4µs  med=344.22µs max=14.71ms  p(90)=407.94µs p(95)=457.87µs
     ✓ { mode:uws }...............................: avg=348.31µs min=268.63µs med=330.76µs max=6ms      p(90)=368.3µs  p(95)=389.21µs
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 256296
     http_req_receiving...........................: avg=32.72µs  min=15.89µs  med=32.1µs   max=3ms      p(90)=38.95µs  p(95)=41.65µs 
     http_req_sending.............................: avg=8.7µs    min=6.03µs   med=7.63µs   max=314.13µs p(90)=11.1µs   p(95)=12.21µs 
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=323.98µs min=190.23µs med=291.31µs max=18.21ms  p(90)=434.5µs  p(95)=459.01µs
     http_reqs....................................: 256296  1708.617805/s
     iteration_duration...........................: avg=580.32µs min=397.36µs med=542.43µs max=18.88ms  p(90)=694.84µs p(95)=726.17µs
     iterations...................................: 256296  1708.617805/s
     vus..........................................: 1       min=1         max=1   
     vus_max......................................: 2       min=2         max=2   

Copy link
Contributor

github-actions bot commented Dec 11, 2024

💻 Website Preview

The latest changes are available as preview in: https://50df81c5.graphql-yoga.pages.dev

@jasonkuhrt
Copy link
Collaborator Author

/home/runner/work/graphql-yoga/graphql-yoga/packages/graphql-yoga/integration-tests/browser.spec.ts
Error: 20:1 error 'playwright' should be listed in the project's dependencies. Run 'npm i -S playwright' to add it import/no-extraneous-dependencies

Ah, this rule is preventing package use of dev deps from monorepo. I'd prefer it allowed it. Will look more into this lint rule.

@ardatan
Copy link
Collaborator

ardatan commented Dec 11, 2024

Ah, this rule is preventing package use of dev deps from monorepo. I'd prefer it allowed it. Will look more into this lint rule.

You can ignore that rule in that specific line

@jasonkuhrt jasonkuhrt marked this pull request as draft December 11, 2024 20:31
@jasonkuhrt
Copy link
Collaborator Author

jasonkuhrt commented Dec 11, 2024

Installing Playwright deps involves two parts: browser binaries and then some other OS deps. OS deps are not currently cached and eat up most time. Between two runs (1, 2, the time went up by 30s (I am assuming b/c of variable registry latency or some such). Investigating. Not sure we need the OS deps. Will try skipping that part.

@jasonkuhrt
Copy link
Collaborator Author

Related microsoft/playwright#7249 (to put this PR on their issue back references).

@jasonkuhrt
Copy link
Collaborator Author

jasonkuhrt commented Dec 11, 2024

Nice, those OS dep installs are not needed.

Now we have 4s Playwright browser install time:

CleanShot 2024-12-11 at 15 41 06@2x

@jasonkuhrt jasonkuhrt requested a review from ardatan December 11, 2024 20:42
@jasonkuhrt jasonkuhrt marked this pull request as ready for review December 11, 2024 20:42
@ardatan ardatan merged commit 8475457 into main Dec 11, 2024
24 checks passed
@ardatan ardatan deleted the chore/speed-up-playwright branch December 11, 2024 22:33
@ardatan
Copy link
Collaborator

ardatan commented Dec 11, 2024

This is great @jasonkuhrt ! I love it <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants