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

Decaffeinate driver #6913

Closed
wants to merge 9 commits into from
Closed

Decaffeinate driver #6913

wants to merge 9 commits into from

Conversation

CypressJoseph
Copy link
Contributor

@CypressJoseph CypressJoseph commented Apr 1, 2020

As part of the conversion of the coffeescript code, we convert driver code to JS.

The only exception is driver/src/cypress/error_messages.coffee, which after conversion didn't feel maintainable. (@bkucera mentioned it might be good to rewrite that templating system from scratch in JavaScript.)

User facing changelog

Additional details

  • This change is part of a larger conversion from coffee to javascript (see Proposal: Convert codebase CoffeeScript => JS => TypeScript #2690)
  • In particular, this change is hopefully going to push forward the typescript version of the project (because most major types have shapes that are defined by code in the driver package`)

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has the original issue been tagged with a release in ZenHub?
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?
  • Have new configuration options been added to the cypress.schema.json?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 1, 2020

Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.

  • Please write [WIP] in the title of your Pull Request if your PR is not ready for review - someone will review your PR as soon as the [WIP] is removed.
  • Please familiarize yourself with the PR Review Checklist and feel free to make updates on your PR based on these guidelines.

PR Review Checklist

If any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'.

User Experience

  • The feature/bugfix is self-documenting from within the product.
  • The change provides the end user with a way to fix their problem (no dead ends).

Functionality

  • The code works and performs its intended function with the correct logic.
  • Performance has been factored in (for example, the code cleans up after itself to not cause memory leaks).
  • The code guards against edge cases and invalid input and has tests to cover it.

Maintainability

  • The code is readable (too many nested 'if's are a bad sign).
  • Names used for variables, methods, etc, clearly describe their function.
  • The code is easy to understood and there are relevant comments explaining.
  • New algorithms are documented in the code with link(s) to external docs (flowcharts, w3c, chrome, firefox).
  • There are comments containing link(s) to the addressed issue (in tests and code).

Quality

  • The change does not reimplement code.
  • There's not a module from the ecosystem that should be used instead.
  • There is no redundant or duplicate code.
  • There are no irrelevant comments left in the code.
  • Tests are testing the code’s intended functionality in the best way possible.

Internal

  • The original issue has been tagged with a release in ZenHub.

@CypressJoseph CypressJoseph requested a review from kuceb April 1, 2020 21:07
@cypress
Copy link

cypress bot commented Apr 1, 2020



Test summary

11 25 0 441


Run details

Project cypress
Status Failed
Commit 63f2647
Started Apr 2, 2020 3:44 PM
Ended Apr 2, 2020 3:45 PM
Duration 00:58 💡
OS Linux Debian - 10.1
Browser Electron 80

View run in Cypress Dashboard ➡️


Failures

Run group: 2x-desktop-gui (Linux, Electron )
runs_list_spec.js Failed
1 Runs List > page display > highlights run nav
settings_spec.js Failed
1 Settings > general functionality > navigates to settings page
setup_project_modal_spec.js Failed
1 Set Up Project > displays 'need to set up' message
specs_list_spec.js Failed
1 Specs List > no specs > displays empty message
login_spec.js Failed
1 Login > pings api server
project_nav_spec.js Failed
1 Project Nav > project nav > displays projects nav
projects_list_spec.js Failed
1 Projects List > general behavior > loads projects and shows loader
global_mode_spec.js Failed
1 Global Mode > shows cypress logo in nav
warning_message_spec.js Failed
1 Warning Message > shows warning
update_banner_spec.js Failed
1 Update Banner > general behavior > checks for updates every 60 minutes
This comment includes only the first 10 test failures. See all 25 failures in the Cypress Dashboard.
Run group: reporter (Linux, Electron )
aliases_spec.coffee Failed
1 ... > has correct alias class
2 ... > has correct alias class
test_errors_spec.js Failed
1 test errors > print to console > hovering shows tooltip
shortcuts_spec.js Failed
1 controls > shortcuts > stops tests
tests_spec.js Failed
1 ... > is collapsed by default
suites_spec.js Failed
1 ... > is expanded by default
controls_spec.js Failed
1 ... > shows 'Tests'
This comment includes only the first 10 test failures. See all 25 failures in the Cypress Dashboard.
Run group: ui-components (Linux, Electron )
dropdown_spec.jsx Failed
1 > displays chosen option and hides others
browser-icon_spec.jsx Failed
1 > displays correct logo for supported browsers
This comment includes only the first 10 test failures. See all 25 failures in the Cypress Dashboard.

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

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

You've commited all the original.coffee files - these should just be for reference at the time of conversion - so you have the original to reference while cleaning up. These should not be committed. You need to delete the original.coffee files before committing any cleanup (See #2 #2690 (comment)).

We should probably have a task for this to make this easier with such a large conversion like this @bkucera?

@jennifer-shehane
Copy link
Member

Also 100% agree about the error_messages file. I tried to convert this once and stopped pretty quickly in 😳

@CypressJoseph
Copy link
Contributor Author

Closing this attempt for now. Ran into hard-to-track-down issues with the e2es. The error messages had to do with globals like $ (and possibly Cypress) not being defined when bindTo was called on them.

I think driver may be extra-difficult to move back to JS because it defines how so much of cypress actually works.

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.

None yet

2 participants