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

Fake user support + puppeteer test #4653

Merged
merged 26 commits into from
Jan 4, 2024
Merged

Fake user support + puppeteer test #4653

merged 26 commits into from
Jan 4, 2024

Conversation

bkrmendy
Copy link
Contributor

@bkrmendy bkrmendy commented Dec 13, 2023

Description

This PR adds a puppeteer test that navigates to a project, logs in with a fake user, creates a comment, and resolves it.

To run the tests, run pnpm run comments-test from /path/to/utopia/puppeteer-tests.

Details

Making the flow above work needed the following changes:

Supporting fake users

With this PR, the server supports an allowlisted fake user (Alice), which is special-cased during the login flow. If the ?fakeUser=alice query param is in the URL at load time, the server will authenticate with a pre-created user.

So far, the server has only supported fake users locally. With this change, the prod environment will support fake users too.

Support setting feature flags via URL params

If the name of a feature flag is added to the query params set to 'true' (such as Commenting=true), that feature flag will be turned on.

Next steps (after merging this PR)

  • update the test to always open the same project on pizza

Copy link
Contributor

github-actions bot commented Dec 13, 2023

Try me

Copy link

relativeci bot commented Dec 13, 2023

Job #9717: Bundle Size — 62.2MiB (~+0.01%).

00a1870(current) vs df0030c master#9709(baseline)

Warning

Bundle contains 66 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
Job #9717
     Baseline
Job #9709
Regression  Initial JS 45.4MiB(~+0.01%) 45.4MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 19.86% 11.6%
No change  Chunks 26 26
No change  Assets 30 30
No change  Modules 4361 4361
No change  Duplicate Modules 470 470
No change  Duplicate Code 30.75% 30.75%
No change  Packages 462 462
No change  Duplicate Packages 65 65
Bundle size by type  Change 1 change Regression 1 regression
                 Current
Job #9717
     Baseline
Job #9709
Regression  JS 62.18MiB (~+0.01%) 62.18MiB
Not changed  HTML 11.54KiB 11.54KiB

View job #9717 reportView tests/pizza-fake-user branch activity

Copy link
Contributor

github-actions bot commented Dec 13, 2023

Performance test results:
(Chart1)
(Chart2)

@bkrmendy bkrmendy marked this pull request as ready for review January 4, 2024 11:28
@Rheeseyb
Copy link
Contributor

Rheeseyb commented Jan 4, 2024

To run the tests as part of the PR process, you'll need to add a job to https://github.com/concrete-utopia/utopia/blob/master/.github/workflows/pull-requests.yml. I can help with that if you need me to. I'd suggest doing that in a follow up PR though, as it requires the server-side changes, which wouldn't be deployed until after this has been merged.

@bkrmendy bkrmendy merged commit b125543 into master Jan 4, 2024
11 checks passed
@bkrmendy bkrmendy deleted the tests/pizza-fake-user branch January 4, 2024 16:37
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.

4 participants