Skip to content

Commit

Permalink
breaking: Remove run-ctand open-ct CLI commands (#30456)
Browse files Browse the repository at this point in the history
* Remove run-ct and open-ct as CLI commands

BREAKING: Remove run-ct and open-ct as CLI commands

* Add changelog entry

* add CLI to changelog
  • Loading branch information
jennifer-shehane authored Oct 25, 2024
1 parent a00e7cb commit 59404e7
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 126 deletions.
1 change: 1 addition & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ _Released 12/3/2024 (PENDING)_

- Removed support for Node.js 16 and Node.js 21. Addresses [#29930](https://github.com/cypress-io/cypress/issues/29930).
- Prebuilt binaries for Linux are no longer compatible with Linux distributions based on glibc <2.28, for example: Ubuntu 14-18, RHEL 7, CentOS 7, Amazon Linux 2. Addresses [#29601](https://github.com/cypress-io/cypress/issues/29601).
- The `cypress open-ct` and `cypress run-ct` CLI commands were removed. Please use `cypress open --component` or `cypress run --component` respectively instead. Addressed in [#30456](https://github.com/cypress-io/cypress/pull/30456)
- The undocumented methods `Cypress.backend('firefox:force:gc')` and `Cypress.backend('log:memory:pressure')` were removed. Addresses [#30222](https://github.com/cypress-io/cypress/issues/30222).

## 13.15.1
Expand Down
20 changes: 0 additions & 20 deletions cli/__snapshots__/cli_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,6 @@ exports['cli help command shows help 1'] = `
version [options] prints Cypress version
open [options] Opens Cypress in the interactive GUI.
run [options] Runs Cypress tests from the CLI without the GUI
open-ct [options] Opens Cypress component testing interactive mode.
Deprecated: use "open --component"
run-ct [options] Runs all Cypress component testing suites. Deprecated:
use "run --component"
install [options] Installs the Cypress executable matching this package's
version
verify [options] Verifies that Cypress is installed correctly and
Expand Down Expand Up @@ -263,10 +259,6 @@ exports['cli help command shows help for -h 1'] = `
version [options] prints Cypress version
open [options] Opens Cypress in the interactive GUI.
run [options] Runs Cypress tests from the CLI without the GUI
open-ct [options] Opens Cypress component testing interactive mode.
Deprecated: use "open --component"
run-ct [options] Runs all Cypress component testing suites. Deprecated:
use "run --component"
install [options] Installs the Cypress executable matching this package's
version
verify [options] Verifies that Cypress is installed correctly and
Expand Down Expand Up @@ -303,10 +295,6 @@ exports['cli help command shows help for --help 1'] = `
version [options] prints Cypress version
open [options] Opens Cypress in the interactive GUI.
run [options] Runs Cypress tests from the CLI without the GUI
open-ct [options] Opens Cypress component testing interactive mode.
Deprecated: use "open --component"
run-ct [options] Runs all Cypress component testing suites. Deprecated:
use "run --component"
install [options] Installs the Cypress executable matching this package's
version
verify [options] Verifies that Cypress is installed correctly and
Expand Down Expand Up @@ -344,10 +332,6 @@ exports['cli unknown command shows usage and exits 1'] = `
version [options] prints Cypress version
open [options] Opens Cypress in the interactive GUI.
run [options] Runs Cypress tests from the CLI without the GUI
open-ct [options] Opens Cypress component testing interactive mode.
Deprecated: use "open --component"
run-ct [options] Runs all Cypress component testing suites. Deprecated:
use "run --component"
install [options] Installs the Cypress executable matching this package's
version
verify [options] Verifies that Cypress is installed correctly and
Expand Down Expand Up @@ -457,10 +441,6 @@ exports['cli CYPRESS_INTERNAL_ENV allows and warns when staging environment 1']
version [options] prints Cypress version
open [options] Opens Cypress in the interactive GUI.
run [options] Runs Cypress tests from the CLI without the GUI
open-ct [options] Opens Cypress component testing interactive mode.
Deprecated: use "open --component"
run-ct [options] Runs all Cypress component testing suites. Deprecated:
use "run --component"
install [options] Installs the Cypress executable matching this package's
version
verify [options] Verifies that Cypress is installed correctly and
Expand Down
76 changes: 0 additions & 76 deletions cli/lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ const knownCommands = [
'install',
'open',
'run',
'open-ct',
'run-ct',
'verify',
'-v',
'--version',
Expand Down Expand Up @@ -482,80 +480,6 @@ module.exports = {
.catch(util.logErrorExit1)
})

program
.command('open-ct')
.usage('[options]')
.description('Opens Cypress component testing interactive mode. Deprecated: use "open --component"')
.option('-b, --browser <browser-path>', text('browser'))
.option('-c, --config <config>', text('config'))
.option('-C, --config-file <config-file>', text('configFile'))
.option('-d, --detached [bool]', text('detached'), coerceFalse)
.option('-e, --env <env>', text('env'))
.option('--global', text('global'))
.option('-p, --port <port>', text('port'))
.option('-P, --project <project-path>', text('project'))
.option('--dev', text('dev'), coerceFalse)
.action((opts) => {
debug('opening Cypress')

const msg = `
${logSymbols.warning} Warning: open-ct is deprecated and will be removed in a future release.
Use \`cypress open --component\` instead.
`

logger.warn()
logger.warn(stripIndent(msg))
logger.warn()

require('./exec/open')
.start({ ...util.parseOpts(opts), testingType: 'component' })
.then(util.exit)
.catch(util.logErrorExit1)
})

program
.command('run-ct')
.usage('[options]')
.description('Runs all Cypress component testing suites. Deprecated: use "run --component"')
.option('-b, --browser <browser-name-or-path>', text('browser'))
.option('--ci-build-id <id>', text('ciBuildId'))
.option('-c, --config <config>', text('config'))
.option('-C, --config-file <config-file>', text('configFile'))
.option('-e, --env <env>', text('env'))
.option('--group <name>', text('group'))
.option('-k, --key <record-key>', text('key'))
.option('--headed', text('headed'))
.option('--headless', text('headless'))
.option('--no-exit', text('exit'))
.option('--parallel', text('parallel'))
.option('-p, --port <port>', text('port'))
.option('-P, --project <project-path>', text('project'))
.option('-q, --quiet', text('quiet'))
.option('--record [bool]', text('record'), coerceFalse)
.option('-r, --reporter <reporter>', text('reporter'))
.option('-o, --reporter-options <reporter-options>', text('reporterOptions'))
.option('-s, --spec <spec>', text('spec'))
.option('-t, --tag <tag>', text('tag'))
.option('--dev', text('dev'), coerceFalse)
.action((opts) => {
debug('running Cypress run-ct')

const msg = `
${logSymbols.warning} Warning: run-ct is deprecated and will be removed in a future release.
Use \`cypress run --component\` instead.
`

logger.warn()
logger.warn(stripIndent(msg))
logger.warn()

require('./exec/run')
.start({ ...util.parseOpts(opts), testingType: 'component' })
.then(util.exit)
.catch(util.logErrorExit1)
})

program
.command('install')
.usage('[options]')
Expand Down
24 changes: 0 additions & 24 deletions cli/test/lib/cli_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,34 +635,10 @@ describe('cli', () => {
expect(spawn.start.firstCall.args[0]).to.include('component')
})

it('spawns server with correct args for deprecated component-testing command', () => {
this.exec('open-ct --dev')
expect(spawn.start.firstCall.args[0]).to.include('--testing-type')
expect(spawn.start.firstCall.args[0]).to.include('component')
})

it('runs server with correct args for component-testing', () => {
this.exec('run --component --dev')
expect(spawn.start.firstCall.args[0]).to.include('--testing-type')
expect(spawn.start.firstCall.args[0]).to.include('component')
})

it('runs server with correct args for deprecated component-testing command', () => {
this.exec('run-ct --dev')
expect(spawn.start.firstCall.args[0]).to.include('--testing-type')
expect(spawn.start.firstCall.args[0]).to.include('component')
})

it('does display open-ct command in the help', () => {
return execa('bin/cypress', ['help']).then((result) => {
expect(result).to.include('open-ct')
})
})

it('does display run-ct command in the help', () => {
return execa('bin/cypress', ['help']).then((result) => {
expect(result).to.include('run-ct')
})
})
})
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"cypress:open:debug": "node ./scripts/debug.js cypress:open",
"precypress:run": "yarn ensure-deps",
"cypress:run": "cypress run --dev",
"cypress:run:ct": "cypress run-ct --dev",
"cypress:run:ct": "cypress run --component --dev",
"precypress:run:debug": "yarn ensure-deps",
"cypress:run:debug": "node ./scripts/debug.js cypress:run",
"cypress:verify": "cypress verify --dev",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/errors/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1257,9 +1257,9 @@ export const AllCypressErrors = {
Please remove this flag from: ${fmt.path(arg1.configFile)}
Component Testing is now a standalone command. You can now run your component tests with:
Component Testing is now a supported testing type. You can run your component tests with:
${fmt.terminal(`cypress open-ct`)}
${fmt.terminal(`cypress open --component`)}
https://on.cypress.io/migration-guide`
},
Expand Down
2 changes: 1 addition & 1 deletion system-tests/test/run_ct_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const systemTests = require('../lib/system-tests').default

describe('run-ct', () => {
describe('run ct', () => {
systemTests.setup()

systemTests.it('reports correct exit code when failing', {
Expand Down

3 comments on commit 59404e7

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 59404e7 Oct 25, 2024

Choose a reason for hiding this comment

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

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.15.0/linux-x64/release/14.0.0-59404e7c6f5e71f82a7691f68fa11a6c973abd48/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 59404e7 Oct 25, 2024

Choose a reason for hiding this comment

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

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.15.0/linux-arm64/release/14.0.0-59404e7c6f5e71f82a7691f68fa11a6c973abd48/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 59404e7 Oct 25, 2024

Choose a reason for hiding this comment

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

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.15.0/win32-x64/release/14.0.0-59404e7c6f5e71f82a7691f68fa11a6c973abd48/cypress.tgz

Please sign in to comment.