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

Blocks E2E: Setup block theme without opening browser #44702

Merged
merged 9 commits into from Feb 20, 2024

Conversation

WunderBart
Copy link
Contributor

@WunderBart WunderBart commented Feb 16, 2024

Changes proposed in this Pull Request:

In block-theme.setup.ts:

  • Verify the theme was set without opening the browser,
  • Remove obsolete wp rewrite flush as it's already called within the preceding wp rewrite structure call,
  • Add more assertions to ensure the env is setup correctly.

How to test the changes in this Pull Request:

  1. Change the theme slug in block-theme.setup.ts to a non-existing theme.

  2. Run some test that uses the block_theme.setup.ts, for example:

    pnpm test:e2e:side-effects -g "should show only products that match the filter"
    
  3. Ensure the assertion failed and printed Could not install and/or activate ${ BLOCK_THEME_SLUG }.

- For initial call it improves the speed from ~8.5s to ~5.3s (~38%).
- For subsequent calls it goes down from ~8.5s to ~230ms (~97%) by recognizing the theme being already set.

These absolute measurements are valid ForMyMachine™ :)
Copy link
Contributor

github-actions bot commented Feb 16, 2024

Hi @lanej0, @gigitux, @kmanijak, @woocommerce/woo-fse

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Feb 16, 2024
@WunderBart WunderBart self-assigned this Feb 16, 2024
@WunderBart WunderBart added the focus: e2e tests Issues related to e2e tests label Feb 16, 2024
Copy link
Contributor

github-actions bot commented Feb 16, 2024

Test Results Summary

Commit SHA: 472caa7

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 37s
E2E Tests32900703367m 29s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@github-actions github-actions bot removed the focus: e2e tests Issues related to e2e tests label Feb 19, 2024
@WunderBart WunderBart changed the title [E2E] Activate block theme via the rest API instead via CLI [E2E] Check if theme is active in block theme setup Feb 19, 2024
@WunderBart WunderBart changed the title [E2E] Check if theme is active in block theme setup [E2E] Validate active theme without opening browser in block theme setup Feb 19, 2024
@WunderBart WunderBart changed the title [E2E] Validate active theme without opening browser in block theme setup [E2E] Setup block theme without opening browser Feb 19, 2024
Copy link
Contributor

@kmanijak kmanijak left a comment

Choose a reason for hiding this comment

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

Thanks for the improvement!

There are some flaky tests failing that require restarting, otherwise all good!

@WunderBart WunderBart merged commit b8d2136 into trunk Feb 20, 2024
57 checks passed
@WunderBart WunderBart deleted the tweak/block-theme-e2e-setup branch February 20, 2024 15:52
@github-actions github-actions bot added this to the 8.7.0 milestone Feb 20, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Feb 20, 2024
@nigeljamesstevenson nigeljamesstevenson added status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Feb 21, 2024
@WunderBart WunderBart changed the title [E2E] Setup block theme without opening browser Blocks E2E: Setup block theme without opening browser May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants