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

Introduce WebkitHeadless browser testing #8491

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

dlarocque
Copy link
Contributor

Introduce WebKitHeadless browser testing, using the karma-webkit-launcher plugin. The plugin uses playwright to launch it's WebkitHeadless browser, and uses that browser to run karma tests on.

This is significantly better than the proposed solution in #8396, where we forked the old karma-safari-launcher plugin, because it uses a headless browser. This means that

  • We don't need to manually enable Full Disk Access on Safari to the host process
  • The headless browser process will exit after tests are complete
  • There are no browser popups when running the tests, since there's no head to pop up

How to run locally:

yarn install # make sure the new packages are installed
npx playwright install webkit # install playwright's webkit browser
BROWSERS='WebkitHeadless' yarn test:browser # or any other command that launches a browser for karma tests

Testing:

I ran all of the browser tests against WebkitHeadless locally, and did not encounter any unexpected failures (the flakes in firestore still occur). Everything works as expected.

When running the same tests in CI, I noticed that several packages are now flaky (seemingly only in CI?): installations, storage-compat, database, database-compat, app-check. It's not clear why these are suddenly only failing in the headless webkit browser in CI, so let's skip them for now, and add a TODO to fix this later.

Replace Safari with WebkitHeadless in list of supported karma browsers

Install playwright browsers in CI

Set WEBKIT_HEADLESS_BIN

Update launcher version

Run firestore test changed on push

Fix

Don't use  in test-changed-firestore

Ignore failing tests
@dlarocque dlarocque requested a review from a team as a code owner September 9, 2024 17:42
Copy link

changeset-bot bot commented Sep 9, 2024

⚠️ No Changeset found

Latest commit: 1e2561b

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 9, 2024

Size Report 1

Affected Products

  • @firebase/auth

    TypeBase (3670ab8)Merge (2f74ea7)Diff
    browser182 kB182 kB+81 B (+0.0%)
    cordova209 kB209 kB+85 B (+0.0%)
    esm5236 kB236 kB+85 B (+0.0%)
    main179 kB179 kB+71 B (+0.0%)
    module182 kB182 kB+81 B (+0.0%)
    react-native199 kB199 kB+71 B (+0.0%)
  • @firebase/auth-cordova

    TypeBase (3670ab8)Merge (2f74ea7)Diff
    browser209 kB209 kB+85 B (+0.0%)
    module209 kB209 kB+85 B (+0.0%)
  • @firebase/auth-web-extension

    TypeBase (3670ab8)Merge (2f74ea7)Diff
    browser137 kB137 kB+81 B (+0.1%)
    main152 kB152 kB+69 B (+0.0%)
    module137 kB137 kB+81 B (+0.1%)
  • @firebase/auth/internal

    TypeBase (3670ab8)Merge (2f74ea7)Diff
    browser193 kB193 kB+81 B (+0.0%)
    esm5249 kB249 kB+85 B (+0.0%)
    main214 kB214 kB+73 B (+0.0%)
    module193 kB193 kB+81 B (+0.0%)
  • @firebase/util

    TypeBase (3670ab8)Merge (2f74ea7)Diff
    browser23.2 kB23.4 kB+131 B (+0.6%)
    esm524.9 kB25.0 kB+131 B (+0.5%)
    main30.7 kB30.9 kB+233 B (+0.8%)
    module23.2 kB23.4 kB+131 B (+0.6%)
  • bundle

    TypeBase (3670ab8)Merge (2f74ea7)Diff
    auth (Anonymous)76.1 kB76.2 kB+119 B (+0.2%)
    auth (EmailAndPassword)84.4 kB84.5 kB+119 B (+0.1%)
    auth (GoogleFBTwitterGitHubPopup)103 kB103 kB+118 B (+0.1%)
    auth (GooglePopup)100 kB100 kB+119 B (+0.1%)
    auth (GoogleRedirect)100 kB100 kB+119 B (+0.1%)
    auth (Phone)86.8 kB86.9 kB+119 B (+0.1%)
  • firebase

    TypeBase (3670ab8)Merge (2f74ea7)Diff
    firebase-app.js103 kB103 kB+2 B (+0.0%)
    firebase-auth-compat.js139 kB139 kB+88 B (+0.1%)
    firebase-auth-cordova.js177 kB177 kB+124 B (+0.1%)
    firebase-auth-web-extension.js117 kB117 kB+128 B (+0.1%)
    firebase-auth.js151 kB151 kB+128 B (+0.1%)
    firebase-compat.js788 kB788 kB+88 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/2bjOYN9UmN.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 9, 2024

Size Analysis Report 1

This report is too large (126,839 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/mJ5ZP4isTN.html

run: yarn build:changed core
- name: Run tests on changed packages
run: |
npx lerna run test:browser --scope @firebase/database-compat
Copy link
Contributor

Choose a reason for hiding this comment

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

?

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.

3 participants