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

CLI caching #1699

Merged
merged 21 commits into from
May 16, 2018
Merged

CLI caching #1699

merged 21 commits into from
May 16, 2018

Conversation

kuceb
Copy link
Contributor

@kuceb kuceb commented May 9, 2018

closes #1300 #1254 #890

@kuceb
Copy link
Contributor Author

kuceb commented May 10, 2018

Code coverage with nyc crept in here too

exports['version already installed 1'] = `
Cypress 1.2.3 is already installed. Skipping installation.
exports['continues installing on failure 1'] = `
Installed version ([object Object]) does not match needed version (1.2.3).
Copy link
Contributor

Choose a reason for hiding this comment

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

JavaScript classic [object Object]

cli/lib/cli.js Outdated
@@ -114,6 +116,7 @@ module.exports = {
.option('--group', text('group'), coerceFalse)
.option('--group-id <group-id>', text('groupId'))
.option('--dev', text('dev'), coerceFalse)
.option('--cypress-path <cypress path>', text('cypressPath'))
Copy link
Contributor

Choose a reason for hiding this comment

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

probably want to say this is cypress folder otherwise it might seem like Cypress app filepath

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should we do --cypress-dir or --cypress-folder? or something longer like --path-to-binary

cli/lib/cli.js Outdated
require('./tasks/verify')
.start({ force: true, welcomeMessage: false })
.start(_.extend(parseOpts(opts), { force: true, welcomeMessage: false }))
Copy link
Contributor

Choose a reason for hiding this comment

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

could be better split into options + start

const defaultOption = { force: true, welcomeMessage: false }
const parsed = parseOpts(opts)
const options = _.extend(parsed, defaultOptions)
require('./tasks/verify')
  .start(options)

@@ -12,17 +12,24 @@
"scripts": {
"test": "npm run test-unit",
"test-unit": "npm run dtslint && npm run unit",
"test-watch": "bin-up mocha --watch",
"test-watch": "npm run unit -- --watch",
Copy link
Contributor

Choose a reason for hiding this comment

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

I get what you are doing - reusing npm run unit command, good

@bahmutov
Copy link
Contributor

nice, nice, what are we doing to store nyc coverage?

also, can we think how we are going to test it - maybe on Circle after building binary... It can be done in a separate commits later after this lands.

@@ -1,6 +1,7 @@
{
"globals": {
"lib": true
"lib": true,
"mocha": true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe remove this

@@ -2,127 +2,128 @@ require('../../spec_helper')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rename to state_spec.js

@@ -32,13 +39,15 @@
"@types/bluebird": "3.5.18",
"@types/chai": "4.0.8",
"@types/chai-jquery": "1.1.35",
"@types/chalk": "2.2.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why are @types in dependencies over devDependencies?

@kuceb
Copy link
Contributor Author

kuceb commented May 11, 2018

  • Log to user where cypress binary was installed

@kuceb
Copy link
Contributor Author

kuceb commented May 11, 2018

changing binary directory to be cache/Cypress/1.2.3/Cypress.app (MacOS) instead of cache/Cypress/1.2.3, so users can specify the 'Cypress.app' folder as the binary instead of the parent of that folder

  • change binary folder

@brian-mann
Copy link
Member

@bkucera can you sign the CLA? Thanks

@jennifer-shehane
Copy link
Member

@brian-mann I'm not sure what's happened with the cla-assistant on this PR, but it appears to be bugging.

I manually checked and verified that @bkucera signed the CLA for cypress-io/cypress on Apr 13, 2018 5:37:08 PM

@brian-mann
Copy link
Member

I told the CLA assistant to recheck PR's and it's ready to be merged now.

@bkucera did you have anything else to add to this PR or is it ready to go? Did you manually test everything, setting env vars, changing cache location, installing current version of Cypress, etc?

Did you try manually testing it from another project after Cypress has been installed from a different project?

@kuceb
Copy link
Contributor Author

kuceb commented May 14, 2018

@brian-mann trying to keep #1300 current with progress, but I need to finish
manual testing, custom error message for failed access to cache directory, and docs

@kuceb
Copy link
Contributor Author

kuceb commented May 15, 2018

@brian-mann one feature left, need to always use cache when CYPRESS_BINARY_VERSION is url, and tell user that, so if cypress is already cached on that version and env var is set to URL, tell user to use --force to force install from URL

@kuceb kuceb requested a review from brian-mann May 16, 2018 02:39
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.

Proposal: download Cypress to the common cached folder
4 participants