mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-14 02:50:04 -06:00
* fix: strip dbus messaging from cli launcher stderr * persist prerelease binaries * expand pattern * chore: fix changelog (#32552) * chore: release 15.3.0 (#32553) * chore: add branches on semantic-pull-request workflow (#32560) * chore: update validate changelog to pull target branch (#32561) * chore: Update Chrome (stable) to 140.0.7339.207 (#32563) * chore: Update Chrome (stable) to 140.0.7339.207 * empty commit --------- Co-authored-by: cypress-bot[bot] <41898282+cypress-bot[bot]@users.noreply.github.com> Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com> * updates changelog * Update CHANGELOG.md --------- Co-authored-by: Jennifer Shehane <jennifer@cypress.io> Co-authored-by: Bill Glesias <bglesias@gmail.com> Co-authored-by: Matt Schile <mschile@cypress.io> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: cypress-bot[bot] <41898282+cypress-bot[bot]@users.noreply.github.com> Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
110 lines
3.0 KiB
TypeScript
110 lines
3.0 KiB
TypeScript
/* eslint-disable no-console */
|
|
import { start as spawnStart } from './spawn'
|
|
import util from '../util'
|
|
import state from '../tasks/state'
|
|
import os from 'os'
|
|
import chalk from 'chalk'
|
|
import prettyBytes from 'pretty-bytes'
|
|
import _ from 'lodash'
|
|
|
|
// color for numbers and show values
|
|
const g = chalk.green
|
|
// color for paths
|
|
const p = chalk.cyan
|
|
const red = chalk.red
|
|
// urls
|
|
const link = chalk.blue.underline
|
|
|
|
// to be exported
|
|
const methods: any = {}
|
|
|
|
methods.findProxyEnvironmentVariables = (): any => {
|
|
return _.pick(process.env, ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY'])
|
|
}
|
|
|
|
const maskSensitiveVariables = (obj: any): any => {
|
|
const masked = { ...obj }
|
|
|
|
if (masked.CYPRESS_RECORD_KEY) {
|
|
masked.CYPRESS_RECORD_KEY = '<redacted>'
|
|
}
|
|
|
|
return masked
|
|
}
|
|
|
|
methods.findCypressEnvironmentVariables = (): any => {
|
|
const isCyVariable = (val: any, key: string): boolean => key.startsWith('CYPRESS_')
|
|
|
|
return _.pickBy(process.env, isCyVariable)
|
|
}
|
|
|
|
const formatCypressVariables = (): any => {
|
|
const vars = methods.findCypressEnvironmentVariables()
|
|
|
|
return maskSensitiveVariables(vars)
|
|
}
|
|
|
|
methods.start = async (options: any = {}): Promise<void> => {
|
|
const args = ['--mode=info']
|
|
|
|
await spawnStart(args, {
|
|
dev: options.dev,
|
|
})
|
|
|
|
console.log()
|
|
const proxyVars = methods.findProxyEnvironmentVariables()
|
|
|
|
if (_.isEmpty(proxyVars)) {
|
|
console.log('Proxy Settings: none detected')
|
|
} else {
|
|
console.log('Proxy Settings:')
|
|
_.forEach(proxyVars, (value: any, key: string) => {
|
|
console.log('%s: %s', key, g(value))
|
|
})
|
|
|
|
console.log()
|
|
console.log('Learn More: %s', link('https://on.cypress.io/proxy-configuration'))
|
|
console.log()
|
|
}
|
|
|
|
const cyVars = formatCypressVariables()
|
|
|
|
if (_.isEmpty(cyVars)) {
|
|
console.log('Environment Variables: none detected')
|
|
} else {
|
|
console.log('Environment Variables:')
|
|
_.forEach(cyVars, (value: any, key: string) => {
|
|
console.log('%s: %s', key, g(value))
|
|
})
|
|
}
|
|
|
|
console.log()
|
|
console.log('Application Data:', p(util.getApplicationDataFolder()))
|
|
console.log('Browser Profiles:', p(util.getApplicationDataFolder('browsers')))
|
|
console.log('Binary Caches: %s', p(state.getCacheDir()))
|
|
|
|
console.log()
|
|
|
|
const osVersion = await util.getOsVersionAsync()
|
|
const buildInfo = util.pkgBuildInfo()
|
|
const isStable = buildInfo && buildInfo.stable
|
|
|
|
console.log('Cypress Version: %s', g(util.pkgVersion()), isStable ? g('(stable)') : red('(pre-release)'))
|
|
console.log('System Platform: %s (%s)', g(os.platform()), g(osVersion))
|
|
console.log('System Memory: %s free %s', g(prettyBytes(os.totalmem())), g(prettyBytes(os.freemem())))
|
|
|
|
if (!buildInfo) {
|
|
console.log()
|
|
console.log('This is the', red('development'), '(un-built) Cypress CLI.')
|
|
} else if (!isStable) {
|
|
console.log()
|
|
console.log('This is a', red('pre-release'), 'build of Cypress.')
|
|
console.log('Build info:')
|
|
console.log(' Commit SHA:', g(buildInfo.commitSha))
|
|
console.log(' Commit Branch:', g(buildInfo.commitBranch))
|
|
console.log(' Commit Date:', g(buildInfo.commitDate))
|
|
}
|
|
}
|
|
|
|
export default methods
|