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

feat(app): decouple event manager from driver #18695

Merged
merged 23 commits into from
Nov 3, 2021

Conversation

lmiller1990
Copy link
Contributor

@lmiller1990 lmiller1990 commented Oct 29, 2021

  • turn eventManager into a class instead of an object
  • create new EventManager at the top of the runner, pass down as props (avoid global singleton import)
    • this makes it much easier to write tests, especially component tests, that use EventManager, since it's easy to create a new one for each test that's isolated
  • inject driver and some other dependencies into event-manager
    • this allows us to easily import event manager into Vite (no circular dependency problem) and minimize the reliance on the hacky webpack bundle injection we are doing
  • move event-manager to app directory, import back to runner and runner-shared
  • updated some tests

This one is probably best to pair code review on. I will write up more reviewing notes and points of interest once CI is green.

Jira: https://cypress-io.atlassian.net/browse/UNIFY-511

TODO before moving out of draft:

  • fix ts-check. It's failing, most likely because I am importing socket in EventManager, and this is spreading app's strict TS config to the older, less type safe packages.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 29, 2021

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Oct 29, 2021



Test summary

18568 1 216 7Flakiness 3


Run details

Project cypress
Status Failed
Commit 575eabb
Started Nov 2, 2021 5:39 PM
Ended Nov 2, 2021 5:56 PM
Duration 17:45 💡
OS Linux Debian - 10.9
Browser Multiple

View run in Cypress Dashboard ➡️


Failures

cypress/integration/e2e/redirects_spec.js Failed
1 redirection > meta > binds to the new page after a timeout

Flakiness

commands/net_stubbing_spec.ts Flakiness
1 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"
cypress/proxy-logging-spec.ts Flakiness
1 ... > works with forceNetworkError
settings_spec.js Flakiness
1 Settings > file preference panel > loads preferred editor and available editors

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@@ -78,8 +78,10 @@
"@urql/exchange-execute",
"@urql/vue",
"@vueuse/core",
"bluebird",
Copy link
Contributor Author

@lmiller1990 lmiller1990 Oct 29, 2021

Choose a reason for hiding this comment

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

Probably don't want to bundle bluebird here, but grab it from the webpack bundle 🤔 so we don't bundle it twice.

Can look into this, not a big deal right now, since lots more work to come around minimizing the use the webpack bundle.

@lmiller1990 lmiller1990 marked this pull request as ready for review October 29, 2021 14:23
@lmiller1990 lmiller1990 requested a review from a team as a code owner October 29, 2021 14:23
@lmiller1990 lmiller1990 requested review from jennifer-shehane, brian-mann and a team and removed request for a team and jennifer-shehane October 29, 2021 14:23
}

// Stub AutIframe, useful for component testing
export const createTestAutIframe = (eventManager = createEventManager()) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are just glorified stubs, but useful for component tests.

@lmiller1990
Copy link
Contributor Author

lmiller1990 commented Nov 2, 2021

Pair reviewed w/ Zach W, talked with Brian about it, gonna merge this up and keep going.

@lmiller1990 lmiller1990 merged commit 69d316e into unified-desktop-gui Nov 3, 2021
@lmiller1990 lmiller1990 deleted the lmiller1990/inject-cypress-driver branch November 3, 2021 01:28
tgriesser added a commit that referenced this pull request Nov 4, 2021
…ve-activeProject

* unified-desktop-gui: (57 commits)
  chore: Add e2e tests for global mode (#18719)
  chore: add percy to app and launchpad package (#18781)
  chore: update test
  refactor: move settings in app (#18729)
  feat: setup launchpad lifecycle (#18734)
  feat(app): decouple event manager from driver (#18695)
  chore: Force single resolution for core modules, infinite loop guard (#18764)
  fix(driver): Sticky elements within a fixed container will not prevent an element from being scrolled to (#18441)
  chore: cleaning up the runner container pattern (#18741)
  feat: Use .config files (#18578)
  chore(app): basic style and example to stop scrollIntoView bug (#18736)
  chore: make `create` function on server.ts obsolete (#18615)
  feat: add codegen utility (#18708)
  docs: Add instructions to squash commits to develop in Contributing (#18728)
  fix(@cypress/react): throw if using Next.js swc-loader without nodeVersion=system (#18686)
  refactor: remove Ramda (#18723)
  fix: support using create-cypress-tests as part of build process (#18714)
  chore: Increase paralleled machines for desktop-gui tests (#18725)
  fix(app): do not cache graphql (#18716)
  chore: Update Chrome (stable) to 95.0.4638.69 (#18696)
  ...
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.

1 participant