Skip to content

ci: Run browser integration tests also on Firefox and Webkit #4232

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

Merged

Conversation

rhcarvalho
Copy link
Contributor

This is a follow up to #4226, expanding the target browsers from Chrome to Chrome + Firefox + Webkit.

We configure a job matrix to run browser tests in parallel, even though Karma could connect to all browsers at once. The reason for this is that, if run time is not a concern (less than 2min at the moment), running each browser as a separate job seemed more robust and easier to spot browser-specific problems when a test fails.

We get all browser binaries from Playwright, so we don't need to rely on versions installed on the host system. (And this is also the easiest way to get a headless Webkit browser on Ubuntu)

We include the Playwright browsers in cache to avoid having to download them again over and over.

We install Webkit system dependencies on every run of the Webkit tests because it is inconvenient to cache and restore system dependencies. Installing then is safer, and perhaps even faster, than dealing with the cache.

We configure a job matrix to run browser tests in parallel, even though
Karma could connect to all browsers at once. The reason for this is
that, if run time is not a concern (less than 2min at the moment),
running each browser as a separate job seemed more robust and easier to
spot browser-specific problems when a test fails.

We get all browser binaries from Playwright, so we don't need to rely on
versions installed on the host system. (And this is also the easiest way
to get a headless Webkit browser on Ubuntu)

We include the Playwright browsers in cache to avoid having to download
them again over and over.

We install Webkit system dependencies on every run of the Webkit tests
because it is inconvenient to cache and restore system dependencies.
Installing then is safer, and perhaps even faster, than dealing with the
cache.
@rhcarvalho rhcarvalho added this to the Release Stability milestone Dec 3, 2021
@rhcarvalho rhcarvalho requested review from a team, AbhiPrasad and iker-barriocanal and removed request for a team December 3, 2021 20:14
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2021

size-limit report

Path Base Size (bfd74df) Current Size Change
@sentry/browser - CDN Bundle (gzipped) 22.45 KB 22.45 KB +0.01% 🔺
@sentry/browser - Webpack 23.29 KB 23.29 KB 0%
@sentry/react - Webpack 23.32 KB 23.32 KB 0%
@sentry/nextjs Client - Webpack 47.98 KB 47.98 KB 0%
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 29.9 KB 29.9 KB +0.01% 🔺

Copy link
Member

@lobsterkatie lobsterkatie left a comment

Choose a reason for hiding this comment

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

LGTM!

needs: job_build
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 10
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reducing this from 15 to 10 (another value we use in jobs in this workflow) to emphasize these tests should run relatively fast. The 10 min timeout is for each browser/job.

@@ -10,6 +10,7 @@ env:
CACHED_DEPENDENCY_PATHS: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/packages/**/node_modules
~/.cache/ms-playwright/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

An alternative to this was to

Set PLAYWRIGHT_BROWSERS_PATH=0 as the environment variable before running npm install. This will download the browser binaries in the node_modules directory and cache them with the package code.

(from https://playwright.dev/docs/ci/#caching-browsers)

@rhcarvalho rhcarvalho merged commit 3fef982 into master Dec 3, 2021
@rhcarvalho rhcarvalho deleted the rhcarvalho/browser-integration-tests-firefox-webkit branch December 3, 2021 21:02
onurtemizkan pushed a commit that referenced this pull request Dec 19, 2021
We configure a job matrix to run browser tests in parallel, even though
Karma could connect to all browsers at once. The reason for this is
that, if run time is not a concern (less than 2min at the moment),
running each browser as a separate job seemed more robust and easier to
spot browser-specific problems when a test fails.

We get all browser binaries from Playwright, so we don't need to rely on
versions installed on the host system. (And this is also the easiest way
to get a headless Webkit browser on Ubuntu)

We include the Playwright browsers in cache to avoid having to download
them again over and over.

We install Webkit system dependencies on every run of the Webkit tests
because it is inconvenient to cache and restore system dependencies.
Installing then is safer, and perhaps even faster, than dealing with the
cache.
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