Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f471e80
use Node path from config file to run plugins
bahmutov Jun 11, 2019
57c1334
add finding system node
bahmutov Jun 11, 2019
7a88a66
memoize node find, use fix-path if Node is not found
bahmutov Jun 12, 2019
9b46da3
find Node asynchronously
bahmutov Jun 12, 2019
c8af454
update note on ENFILE
bahmutov Jun 12, 2019
a8aac10
print node version before executing registered event
bahmutov Jun 12, 2019
815f720
Merge branch 'develop' into external-node-for-plugins-4432
bahmutov Jun 13, 2019
575cd93
use nodeVersion option, add validator isOneOf
bahmutov Jun 13, 2019
d68b2d5
linting
bahmutov Jun 13, 2019
a287dec
remove resolve-dir
bahmutov Jun 13, 2019
4fe9b5c
debugging unit test
bahmutov Jun 13, 2019
8add01a
resolve original promise to make the tests run correctly
bahmutov Jun 13, 2019
baed50f
update second test
bahmutov Jun 13, 2019
67638b8
add unit tests
bahmutov Jun 13, 2019
dc3c06d
Merge branch 'develop' into external-node-for-plugins-4432
bahmutov Jun 24, 2019
c6f6cee
Merge remote-tracking branch 'origin/develop' into external-node-for-…
flotwig Jul 12, 2019
e4c960f
upgrade snap-shot-it package to be able to update snapshots
bahmutov Jul 12, 2019
bd95263
make finding node path part of startup, merge into config
flotwig Jul 15, 2019
41a5d41
Merge branch 'external-node-for-plugins-4432' of github.com:cypress-i…
flotwig Jul 15, 2019
0dd190a
update tests
flotwig Jul 15, 2019
40a3218
add node version & path to run output
flotwig Jul 15, 2019
1f33e52
add node version display to desktop-gui
flotwig Jul 15, 2019
15c21b7
add warnings, add tests, add learn more link in desktop-gui
flotwig Jul 15, 2019
a86d6bc
Revert "add node version & path to run output"
flotwig Jul 15, 2019
cee7ad4
only show Node Version if it is non-default
flotwig Jul 15, 2019
6ba1349
Add e2e test for using system node
flotwig Jul 15, 2019
05a0405
cleanup
flotwig Jul 15, 2019
7d07873
add tests that resolvedNodePath and Version are available in tests
flotwig Jul 16, 2019
a84a8c4
assert nodeVersion == system
flotwig Jul 16, 2019
b9d46e1
add nodeVersion to schema
flotwig Jul 16, 2019
7c7bd87
add new configoptions to types
flotwig Jul 16, 2019
c5451f3
add fallback if pluginsfile is disabled
flotwig Jul 16, 2019
8ac0bc4
Merge remote-tracking branch 'origin/develop' into external-node-for-…
flotwig Jul 16, 2019
d5216a2
new package.json sorting
flotwig Jul 16, 2019
fa2c9bb
Merge branch 'develop' into external-node-for-plugins-4432
jennifer-shehane Jul 18, 2019
1862dd6
update some of the wording/styling of Node Version panel
jennifer-shehane Jul 18, 2019
96785f3
remove ` from schema file
jennifer-shehane Jul 18, 2019
1a27c38
Merge remote-tracking branch 'origin/develop' into external-node-for-…
flotwig Jul 19, 2019
f1a4aa2
clean up decaffeinated tests + update wording when no pluginsfile is …
flotwig Jul 19, 2019
323a6b9
playing with messaging.
jennifer-shehane Jul 19, 2019
d549475
Merge branch 'develop' into external-node-for-plugins-4432
jennifer-shehane Jul 19, 2019
3893761
push updated node version panel design
jennifer-shehane Jul 19, 2019
1e6210c
Merge remote-tracking branch 'origin/external-node-for-plugins-4432' …
jennifer-shehane Jul 19, 2019
344f468
update design + copy of Node panel again
jennifer-shehane Jul 25, 2019
7eef657
Merge branch 'develop' into external-node-for-plugins-4432
jennifer-shehane Jul 25, 2019
ddb4b03
Merge branch 'develop' into external-node-for-plugins-4432
jennifer-shehane Jul 29, 2019
a685d47
some more iteration on design (WIP)
jennifer-shehane Jul 29, 2019
667fd41
Merge branch 'develop' into external-node-for-plugins-4432
jennifer-shehane Jul 30, 2019
9235c43
Finish design changes + fix tests
jennifer-shehane Jul 30, 2019
8c06803
Merge branch 'develop' into external-node-for-plugins-4432
bahmutov Sep 3, 2019
3adc672
resolve merge conflicts
bahmutov Sep 24, 2019
203af8a
add debug message
bahmutov Sep 24, 2019
d011707
linting problems
bahmutov Sep 24, 2019
8db7bb9
add missed require
bahmutov Sep 24, 2019
4f5cc5b
Merge branch 'develop' into external-node-for-plugins-4432
bahmutov Sep 24, 2019
644e3a0
Merge branch 'develop' into external-node-for-plugins-4432
jennifer-shehane Sep 25, 2019
52ec312
Merge branch 'develop' into external-node-for-plugins-4432
jennifer-shehane Oct 1, 2019
8e53e10
Add comment to refactor the colWidths in this PR after another PR goes
jennifer-shehane Oct 1, 2019
3a03098
replace the exact length of Node version in specfiles
jennifer-shehane Oct 1, 2019
54cd419
print object for node version and path instead of %s %s
jennifer-shehane Oct 1, 2019
f4b6560
update snapshot to match v12 length
jennifer-shehane Oct 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ If an issue already exists you should:

When opening an issue, there is a provided [issue template](./ISSUE_TEMPLATE.md). If the opened issue does not provide enough information asked from the issue template you should:

- Explain that we require new issues follow our provided [issue template](./ISSUE_TEMPLATE.md) and that issues that are opened without this information are automatically closed per our [contributing guidelines](#fill-out-our-issue-template).
- Explain that we require new issues follow our provided [issue template](./ISSUE_TEMPLATE.md) and that issues that are opened without this information are automatically closed per our [contributing guidelines](#fill-out-our-issue-template).
- Close the issue.

### Are they running the current version of Cypress?
Expand Down Expand Up @@ -170,7 +170,7 @@ The best way to determine the validity of a bug is to recreate it yourself. Foll

- Thank them for their contribution.
- Explain that there is not enough information to reproduce the bug. Provide information on how you went about recreating the scenario, if you’re able. Note your OS, Browser, Cypress version and any other information.
- Link them to our contributing guideline for [opening issues](#opening-issues).
- Link them to our contributing guideline for [opening issues](#opening-issues).
- Note that if no reproducible example is provided, we will unfortunately have to close the issue.
- Add the `stage: needs information` label to the issue.

Expand Down Expand Up @@ -362,7 +362,7 @@ When you edit files, you can quickly fix all changed files before you commit usi
npm run lint-changed-fix
```

When committing files, we run a Git pre-commit hook to lint the staged JS files. See the [`lint-staged` project](https://github.com/okonet/lint-staged).
When committing files, we run a Git pre-commit hook to lint the staged JS files. See the [`lint-staged` project](https://github.com/okonet/lint-staged).
If this command fails, you may need to run `npm run lint-changed-fix` and commit those changes.

### Tests
Expand Down Expand Up @@ -455,7 +455,7 @@ To run local tests, consult the `README.md` of each package.

We use [RenovateBot](https://renovatebot.com/) to automatically upgrade our dependencies. The bot uses the settings in [renovate.json](renovate.json) to maintain our [Update Dependencies](https://github.com/cypress-io/cypress/issues/3777) issue and open PRs. You can manually select a package to open a PR from our [Update Dependencies](https://github.com/cypress-io/cypress/issues/3777) issue.

Every PR for a package upgrade requires a review of the packages changes either from their changelog or their commits as well as all of the existing Cypress tests to pass.
Every PR for a package upgrade requires a review of the packages changes either from their changelog or their commits as well as all of the existing Cypress tests to pass.

#### If there are test failures or breaking changes:

Expand All @@ -465,3 +465,9 @@ Every PR for a package upgrade requires a review of the packages changes either
## Deployment

We will try to review and merge pull requests quickly. After merging we will try releasing a new version. If you want to know our build process or build your own Cypress binary, read [DEPLOY.md](DEPLOY.md)

## Known problems

### ENFILE or EMFILE

If you get `ENFILE: file table overflow`, `ENFILE: too many open files` or any other `ENFILE` or `EMFILE` errors on Mac, that means you are doing synchronous file system operations. Cypress should **NEVER** do them. Instead we should use async file system operations and let `graceful-fs` retry them. Find the place where the synchronous `fs` operation is done from the stacktrace and make it async.
8 changes: 8 additions & 0 deletions cli/schema/cypress.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@
"type": "string",
"default": null,
"description": "A 6 character string use to identify this project in the Cypress Dashboard. See https://on.cypress.io/dashboard-service#Identification"
},
"nodeVersion": {
"enum": [
"system",
"bundled"
],
"default": "bundled",
"description": "If set to 'system', Cypress will try to find a Node.js executable on your path to use when executing your plugins. Otherwise, Cypress will use the Node version bundled with Cypress."
}
}
}
15 changes: 15 additions & 0 deletions cli/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2048,11 +2048,26 @@ declare namespace Cypress {
* @default "cypress/integration"
*/
integrationFolder: string
/**
* If set to `system`, Cypress will try to find a `node` executable on your path to use when executing your plugins. Otherwise, Cypress will use the Node version bundled with Cypress.
* @default "bundled"
*/
nodeVersion: "system" | "bundled"
/**
* Path to plugins file. (Pass false to disable)
* @default "cypress/plugins/index.js"
*/
pluginsFile: string
/**
* If `nodeVersion === 'system'` and a `node` executable is found, this will be the full filesystem path to that executable.
* @default null
*/
resolvedNodePath: string
/**
* The version of `node` that is being used to execute plugins.
* @example 1.2.3
*/
resolvedNodeVersion: string
/**
* Path to folder where screenshots will be saved from [cy.screenshot()](https://on.cypress.io/screenshot) command or after a headless or CI run’s test failure
* @default "cypress/screenshots"
Expand Down
6 changes: 6 additions & 0 deletions packages/desktop-gui/cypress/fixtures/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
"report": false,
"reporter": "spec",
"requestTimeout": 5000,
"resolvedNodePath": null,
"resolvedNodeVersion": "1.2.3",
"hosts": {
"*.foobar.com": "127.0.0.1"
},
Expand Down Expand Up @@ -224,6 +226,10 @@
"from": "default",
"value": 30000
},
"pluginsFile": {
"from": "default",
"value": "cypress/plugins/index.js"
},
"port": {
"from": "default",
"value": 2020
Expand Down
80 changes: 60 additions & 20 deletions packages/desktop-gui/cypress/integration/settings_spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
describe('Settings', function () {
const { _ } = Cypress

describe('Settings', () => {
beforeEach(function () {
cy.fixture('user').as('user')
cy.fixture('config').as('config')
Expand Down Expand Up @@ -43,7 +45,7 @@ describe('Settings', function () {
})
})

describe('any case / project is set up for ci', function () {
describe('any case / project is set up for ci', () => {
beforeEach(function () {
this.openProject.resolve(this.config)
this.projectStatuses[0].id = this.config.projectId
Expand All @@ -66,7 +68,7 @@ describe('Settings', function () {
cy.contains(this.config.projectId).should('not.exist')
})

describe('when config panel is opened', function () {
describe('when config panel is opened', () => {
beforeEach(() => {
cy.contains('Configuration').click()
})
Expand All @@ -80,7 +82,7 @@ describe('Settings', function () {
})

it('wraps config line in proper classes', () => {
cy.get('.line').first().within(function () {
cy.get('.line').first().within(() => {
cy.contains('animationDistanceThreshold').should('have.class', 'key')
cy.contains(':').should('have.class', 'colon')
cy.contains('5').should('have.class', 'default')
Expand Down Expand Up @@ -111,7 +113,7 @@ describe('Settings', function () {
.and('contain', ']')
.and('not.contain', '0')
.and('not.contain', '1')
.find('.line .config').should(function ($lines) {
.find('.line .config').should(($lines) => {
expect($lines).to.have.length(2)
expect($lines).to.contain('www.google-analytics.com')

Expand All @@ -126,7 +128,7 @@ describe('Settings', function () {
})
})

describe('when project id panel is opened', function () {
describe('when project id panel is opened', () => {
beforeEach(() => {
cy.contains('Project ID').click()
})
Expand All @@ -136,7 +138,7 @@ describe('Settings', function () {
})
})

describe('when record key panel is opened', function () {
describe('when record key panel is opened', () => {
beforeEach(() => {
cy.contains('Record Key').click()
})
Expand All @@ -159,7 +161,7 @@ describe('Settings', function () {
cy.get('.settings-record-key .fa-spinner')
})

describe('when record key loads', function () {
describe('when record key loads', () => {
beforeEach(function () {
this.getRecordKeys.resolve(this.keys)
})
Expand All @@ -177,7 +179,7 @@ describe('Settings', function () {
})
})

describe('when there are no keys', function () {
describe('when there are no keys', () => {
beforeEach(function () {
this.getRecordKeys.resolve([])
})
Expand All @@ -193,7 +195,7 @@ describe('Settings', function () {
})
})

describe('when the user is logged out', function () {
describe('when the user is logged out', () => {
beforeEach(function () {
this.getRecordKeys.resolve([])

Expand All @@ -204,7 +206,7 @@ describe('Settings', function () {
cy.get('.empty-well').should('contain', 'must be logged in')
})

it('opens login modal after clicking \'Log In\'', function () {
it('opens login modal after clicking \'Log In\'', () => {
cy.get('.empty-well button').click()
cy.get('.login')
})
Expand All @@ -225,7 +227,7 @@ describe('Settings', function () {
})
})

describe('when proxy settings panel is opened', function () {
describe('when proxy settings panel is opened', () => {
beforeEach(() => {
cy.contains('Proxy Settings').click()
})
Expand All @@ -240,7 +242,7 @@ describe('Settings', function () {
})
})

it('with Windows proxy settings indicates proxy and the source', function () {
it('with Windows proxy settings indicates proxy and the source', () => {
cy.setAppStore({
projectRoot: '/foo/bar',
proxySource: 'win32',
Expand All @@ -254,7 +256,7 @@ describe('Settings', function () {
cy.get('.settings-proxy tr:nth-child(2) > td > code').should('contain', 'a, b, c, d')
})

it('with environment proxy settings indicates proxy and the source', function () {
it('with environment proxy settings indicates proxy and the source', () => {
cy.setAppStore({
projectRoot: '/foo/bar',
proxyServer: 'http://foo-bar.baz',
Expand All @@ -267,7 +269,7 @@ describe('Settings', function () {
cy.get('.settings-proxy tr:nth-child(2) > td > code').should('contain', 'a, b, c, d')
})

it('with no bypass list but a proxy set shows \'none\' in bypass list', function () {
it('with no bypass list but a proxy set shows \'none\' in bypass list', () => {
cy.setAppStore({
projectRoot: '/foo/bar',
proxyServer: 'http://foo-bar.baz',
Expand All @@ -277,7 +279,7 @@ describe('Settings', function () {
})
})

context('on:focus:tests clicked', function () {
context('on:focus:tests clicked', () => {
beforeEach(function () {
this.ipc.onFocusTests.yield()
})
Expand All @@ -288,7 +290,7 @@ describe('Settings', function () {
})
})

context('on config changes', function () {
context('on config changes', () => {
beforeEach(function () {
this.projectStatuses[0].id = this.config.projectId
this.getProjectStatus.resolve(this.projectStatuses[0])
Expand All @@ -315,7 +317,45 @@ describe('Settings', function () {
})
})

describe('errors', function () {
describe('when node version panel is opened', () => {
const bundledNodeVersion = '1.2.3'
const systemNodePath = '/foo/bar/node'
const systemNodeVersion = '4.5.6'

beforeEach(function () {
this.navigateWithConfig = function (config) {
this.openProject.resolve(_.defaults(config, this.config))
this.projectStatuses[0].id = this.config.projectId
this.getProjectStatus.resolve(this.projectStatuses[0])
this.goToSettings()
}
})

it('with bundled node informs user we\'re using bundled node', function () {
this.navigateWithConfig({})

cy.contains(`Node.js Version (${bundledNodeVersion})`).click()
cy.get('.node-version')
.should('contain', 'bundled with Cypress')
.should('not.contain', systemNodePath)
.should('not.contain', systemNodeVersion)
})

it('with custom node displays path to custom node', function () {
this.navigateWithConfig({
resolvedNodePath: systemNodePath,
resolvedNodeVersion: systemNodeVersion,
})

cy.contains(`Node.js Version (${systemNodeVersion})`).click()
cy.get('.node-version')
.should('contain', systemNodePath)
.should('contain', systemNodeVersion)
.should('not.contain', bundledNodeVersion)
})
})

describe('errors', () => {
beforeEach(function () {
this.err = {
message: 'Port \'2020\' is already in use.',
Expand Down Expand Up @@ -356,7 +396,7 @@ describe('Settings', function () {
})
})

context('when project is not set up for CI', function () {
context('when project is not set up for CI', () => {
it('does not show ci Keys section when project has no id', function () {
const newConfig = this.util.deepClone(this.config)

Expand All @@ -378,7 +418,7 @@ describe('Settings', function () {
})
})

context('when you are not a user of this projects org', function () {
context('when you are not a user of this projects org', () => {
beforeEach(function () {
this.openProject.resolve(this.config)
})
Expand Down
4 changes: 4 additions & 0 deletions packages/desktop-gui/src/project/project-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const validProps = cacheProps.concat([
'parentTestsFolderDisplay',
'integrationExampleName',
'scaffoldedFiles',
'resolvedNodePath',
'resolvedNodeVersion',
])

export default class Project {
Expand Down Expand Up @@ -59,6 +61,8 @@ export default class Project {
@observable parentTestsFolderDisplay
@observable integrationExampleName
@observable scaffoldedFiles = []
@observable resolvedNodePath
@observable resolvedNodeVersion
// should never change after first set
@observable path
// not observable
Expand Down
2 changes: 2 additions & 0 deletions packages/desktop-gui/src/projects/projects-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ const openProject = (project) => {
id: config.projectId,
name: config.projectName,
configFile: config.configFile,
..._.pick(config, ['resolvedNodeVersion', 'resolvedNodePath']),
})

project.update({ name: config.projectName })
project.setOnBoardingConfig(config)
project.setBrowsers(config.browsers)
project.setResolvedConfig(config.resolved)
Expand Down
Loading