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

[tests-only][full-ci]Cache playwright chromium #11958

Merged
merged 7 commits into from
Dec 3, 2024

Conversation

amrita-shrestha
Copy link
Contributor

@amrita-shrestha amrita-shrestha commented Nov 25, 2024

Description

This PR

  • update PLUGINS_S3 = "plugins/s3:1.5" version
  • cache chromium with respect to playwright version
  • Use cached chromium to run e2e tests
  • add script to get playwright version to store cache

Note

  • can't upgrade minio version because some command are not available in the latest minio image

Related Issue

Motivation and Context

How Has This Been Tested?

  • CI

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests
  • Documentation
  • Maintenance (e.g. dependency updates or tooling)

Open tasks:

  • ...

@amrita-shrestha amrita-shrestha self-assigned this Nov 25, 2024
@amrita-shrestha amrita-shrestha force-pushed the cache-playwright-chromium branch 17 times, most recently from fa7388c to 3bb587f Compare November 28, 2024 05:34
@amrita-shrestha amrita-shrestha marked this pull request as ready for review November 28, 2024 05:38
.drone.star Outdated Show resolved Hide resolved
.drone.star Outdated Show resolved Hide resolved
Copy link
Member

@saw-jan saw-jan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using browsers instead of chromium

.drone.star Outdated Show resolved Hide resolved
.drone.star Outdated Show resolved Hide resolved
.drone.star Outdated Show resolved Hide resolved
.drone.star Outdated Show resolved Hide resolved
.drone.star Outdated Show resolved Hide resolved
.drone.star Outdated Show resolved Hide resolved
.drone.star Outdated Show resolved Hide resolved
.drone.star Outdated Show resolved Hide resolved
.drone.star Outdated Show resolved Hide resolved
tests/drone/script.sh Outdated Show resolved Hide resolved
@ScharfViktor
Copy link
Contributor

thank you Amrita, that is great job 👍
I'm fine with chromium naming if we use only chromium. when we use multi-browser testing in the CI -> we can use abstract name IMHO
I have questions:

  • do we know how long we keep data in the MINIO_MC? what happens if we don't update playwright in for example 30 days and cache will be deleted? should we check that chromium cache is exist?
  • in your PR we install chromium https://drone.owncloud.com/owncloud/web/49324/5/5 but we don't update playwright. it happened since we didn't have the cache, correct? in normal case we don't need install chromium when no playwright update

@amrita-shrestha
Copy link
Contributor Author

amrita-shrestha commented Dec 3, 2024

  • do we know how long we keep data in the MINIO_MC? what happens if we don't update playwright in for example 30 days and cache will be deleted? should we check that chromium cache is exist?
  • in your PR we install chromium https://drone.owncloud.com/owncloud/web/49324/5/5 but we don't update playwright. it happened since we didn't have the cache, correct? in normal case we don't need install chromium when no playwright update

@ScharfViktor, I believe the cache lifespan is 30 days.

check_chromium_cache method verifies the existence of the Chromium cache during each build, based on the Playwright version specified in the package.json file. If the cache is missing, the installChromium and cacheChromium steps are triggered, aligned with the specified Playwright version.

If the bot updates the Playwright version, a new Chromium version will be installed and cached, while the old Chromium cache will remain until its lifespan expires.

It seems adding a script to remove the old cache when a new one is uploaded could interfere with other running builds, so that idea has been dropped to avoid potential disruptions.

Screenshot from 2024-12-03 11-16-54

As shown in the image above, 1.49.0 represents the Playwright version. Currently, the Chromium cached tar file is stored in a directory named after the Playwright version.

@amrita-shrestha amrita-shrestha force-pushed the cache-playwright-chromium branch 3 times, most recently from ac303fd to 6c8ee46 Compare December 3, 2024 05:28
Copy link

sonarqubecloud bot commented Dec 3, 2024

Copy link
Member

@saw-jan saw-jan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@saw-jan saw-jan merged commit 0847bcb into master Dec 3, 2024
4 checks passed
@saw-jan saw-jan deleted the cache-playwright-chromium branch December 3, 2024 06:46
anon-pradip pushed a commit that referenced this pull request Jan 24, 2025
* cache chronium

* cache

* restore-cache

* unskip pipelines

* zip chromium cache

* rename and remove old cache when new version cache uploaded

* don't remove old browser cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[QA] download chromium in Ci only after updating playwright
3 participants