mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-22 15:12:27 -05:00
Merge branch 'develop' into unified-desktop-gui
* develop: (40 commits) fix(driver): Sticky elements within a fixed container will not prevent an element from being scrolled to (#18441) chore: make `create` function on server.ts obsolete (#18615) docs: Add instructions to squash commits to develop in Contributing (#18728) fix(@cypress/react): throw if using Next.js swc-loader without nodeVersion=system (#18686) refactor: remove Ramda (#18723) chore: Increase paralleled machines for desktop-gui tests (#18725) chore: Update Chrome (stable) to 95.0.4638.69 (#18696) chore: release @cypress/vue-v3.0.4 chore: release @cypress/react-v5.10.2 chore: release @cypress/schematic-v1.5.3 fix: remove outdated registry link (#18710) chore: release @cypress/schematic-v1.5.2 chore: release create-cypress-tests-v1.1.3 chore: Update Chrome (beta) to 96.0.4664.27 (#18676) chore(tests): Remove flaky assertion that relies on png how compression (#18668) fix: make sure to go back to no-specs when delete spec file (#17760) fix: Next.JS 12 components testing failing with ` TypeError: Cannot read property 'traceChild' of undefined` (#18648) Backport .gitignore from unified-desktop-gui chore(docs): add 'Upgrading Electron' instructions (#18594) release 8.7.0 [skip ci] ...
This commit is contained in:
+12
-7
@@ -10,7 +10,6 @@ const pluralize = require('pluralize')
|
||||
const execa = require('execa')
|
||||
const electron = require('@packages/electron')
|
||||
const debug = require('debug')('cypress:binary')
|
||||
const R = require('ramda')
|
||||
const la = require('lazy-ass')
|
||||
const check = require('check-more-types')
|
||||
|
||||
@@ -116,7 +115,11 @@ const buildCypressApp = function (platform, version, options = {}) {
|
||||
|
||||
return packages.runAllBuild()
|
||||
// Promise.resolve()
|
||||
.then(R.tap(logBuiltAllPackages))
|
||||
.then((val) => {
|
||||
logBuiltAllPackages(val)
|
||||
|
||||
return val
|
||||
})
|
||||
}
|
||||
|
||||
const copyPackages = function () {
|
||||
@@ -343,7 +346,7 @@ require('./packages/server')\
|
||||
console.log('in build folder %s', buildFolder)
|
||||
|
||||
return execa('ls', ['-la', buildFolder])
|
||||
.then(R.prop('stdout'))
|
||||
.then((val) => val.stdout)
|
||||
.then(console.log)
|
||||
}
|
||||
|
||||
@@ -444,14 +447,16 @@ require('./packages/server')\
|
||||
}
|
||||
|
||||
const printDiskUsage = function (sizes) {
|
||||
const bySize = R.sortBy(R.prop('1'))
|
||||
|
||||
return console.log(bySize(R.toPairs(sizes)))
|
||||
return console.log(_.sortBy(_.toPairs(sizes), 1))
|
||||
}
|
||||
|
||||
return execa('du', args)
|
||||
.then(parseDiskUsage)
|
||||
.then(R.tap(printDiskUsage))
|
||||
.then((val) => {
|
||||
printDiskUsage(val)
|
||||
|
||||
return val
|
||||
})
|
||||
.then((sizes) => {
|
||||
return performanceTracking.track('test runner size', sizes)
|
||||
})
|
||||
|
||||
+12
-22
@@ -4,7 +4,6 @@ const bumpercar = require('@cypress/bumpercar')
|
||||
const path = require('path')
|
||||
const la = require('lazy-ass')
|
||||
const check = require('check-more-types')
|
||||
const R = require('ramda')
|
||||
const { configFromEnvOrJsonFile, filenameToShellVariable } = require('@cypress/env-or-json-file')
|
||||
const makeEmptyGithubCommit = require('make-empty-github-commit')
|
||||
const parse = require('parse-github-repo-url')
|
||||
@@ -88,7 +87,7 @@ const getCiConfig = function () {
|
||||
return config
|
||||
}
|
||||
|
||||
const awaitEachProjectAndProvider = function (projects, fn, filter = R.identity) {
|
||||
const awaitEachProjectAndProvider = function (projects, fn, filter = (val) => val) {
|
||||
const creds = getCiConfig()
|
||||
|
||||
// configure a new Bumpercar
|
||||
@@ -119,7 +118,7 @@ const awaitEachProjectAndProvider = function (projects, fn, filter = R.identity)
|
||||
|
||||
car = bumpercar.create({ providers })
|
||||
|
||||
const filteredProjects = R.filter(filter, projects)
|
||||
const filteredProjects = projects.filter(filter)
|
||||
|
||||
if (check.empty(filteredProjects)) {
|
||||
console.log('⚠️ zero filtered projects left after filtering')
|
||||
@@ -136,26 +135,17 @@ const awaitEachProjectAndProvider = function (projects, fn, filter = R.identity)
|
||||
// do not trigger all projects if there is specific provider
|
||||
// for example appVeyor should be used for Windows testing
|
||||
const getFilterByProvider = function (providerName, platformName) {
|
||||
let platformFilter; let providerFilter
|
||||
return (val) => {
|
||||
if (providerName && val.provider !== providerName) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (providerName) {
|
||||
console.log('only allow projects for provider', providerName)
|
||||
providerFilter = R.propEq('provider', providerName)
|
||||
} else {
|
||||
providerFilter = R.identity
|
||||
if (platformName && val.platform !== platformName) {
|
||||
return false
|
||||
}
|
||||
|
||||
return val
|
||||
}
|
||||
|
||||
if (platformName) {
|
||||
console.log('only allow projects for platform', platformName)
|
||||
platformFilter = R.propEq('platform', platformName)
|
||||
} else {
|
||||
platformFilter = R.identity
|
||||
}
|
||||
|
||||
// combined filter is when both filters pass
|
||||
const projectFilter = R.allPass([providerFilter, platformFilter])
|
||||
|
||||
return projectFilter
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
@@ -199,7 +189,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
return awaitEachProjectAndProvider(PROJECTS, updateProject, projectFilter)
|
||||
.then(R.always(result))
|
||||
.then(() => result)
|
||||
},
|
||||
|
||||
// triggers test projects on multiple CIs
|
||||
|
||||
@@ -12,7 +12,6 @@ const la = require('lazy-ass')
|
||||
const check = require('check-more-types')
|
||||
const debug = require('debug')('cypress:binary')
|
||||
const questionsRemain = require('@cypress/questions-remain')
|
||||
const R = require('ramda')
|
||||
const rp = require('@cypress/request-promise')
|
||||
|
||||
const zip = require('./zip')
|
||||
@@ -37,7 +36,7 @@ const fail = (str) => {
|
||||
return console.log(chalk.bgRed(` ${chalk.black(str)} `))
|
||||
}
|
||||
|
||||
const zippedFilename = R.always(upload.zipName)
|
||||
const zippedFilename = () => upload.zipName
|
||||
|
||||
// goes through the list of properties and asks relevant question
|
||||
// resolves with all relevant options set
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const path = require('path')
|
||||
const la = require('lazy-ass')
|
||||
const check = require('check-more-types')
|
||||
const R = require('ramda')
|
||||
const os = require('os')
|
||||
const _ = require('lodash')
|
||||
|
||||
// canonical platform names
|
||||
const platforms = {
|
||||
@@ -11,11 +11,11 @@ const platforms = {
|
||||
windows: 'win32',
|
||||
}
|
||||
|
||||
const isValidPlatform = check.oneOf(R.values(platforms))
|
||||
const isValidPlatform = check.oneOf(_.values(platforms))
|
||||
|
||||
const checkPlatform = (platform) => {
|
||||
return la(isValidPlatform(platform),
|
||||
'invalid build platform', platform, 'valid choices', R.values(platforms))
|
||||
'invalid build platform', platform, 'valid choices', _.values(platforms))
|
||||
}
|
||||
|
||||
const buildRootDir = () => {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import _ from 'lodash'
|
||||
|
||||
import { s3helpers } from './s3-api'
|
||||
const debug = require('debug')('cypress:binary')
|
||||
import la from 'lazy-ass'
|
||||
@@ -5,7 +7,6 @@ import is from 'check-more-types'
|
||||
// using "arg" module for parsing CLI arguments
|
||||
// because it plays really nicely with TypeScript
|
||||
import arg from 'arg'
|
||||
import { prop, sortBy, last, equals } from 'ramda'
|
||||
import pluralize from 'pluralize'
|
||||
|
||||
// inquirer-confirm is missing type definition
|
||||
@@ -87,9 +88,9 @@ export const findBuildByCommit = (commit: commit, s3paths: string[]) => {
|
||||
|
||||
// each path includes commit SHA and build number, let's pick the last build
|
||||
const parsedBuilds = matching.map(parseBuildPath)
|
||||
const sortedBuilds = sortBy(prop('build'))(parsedBuilds)
|
||||
const sortedBuilds = _.sortBy(parsedBuilds, 'build')
|
||||
|
||||
return prop('s3path', last(sortedBuilds))
|
||||
return _.last(sortedBuilds).s3path
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,14 +142,14 @@ export const moveBinaries = async (args = []) => {
|
||||
// found s3 paths with last build for same commit for all platforms
|
||||
const lastBuilds: Desktop[] = []
|
||||
|
||||
let platforms: platformArch[] = uploadUtils.getValidPlatformArchs()
|
||||
let platforms: platformArch[] = uploadUtils.getValidPlatformArchs() as platformArch[]
|
||||
|
||||
if (options['--platformArch']) {
|
||||
const onlyPlatform = options['--platformArch']
|
||||
|
||||
console.log('only moving single platform %s', onlyPlatform)
|
||||
la(uploadUtils.isValidPlatformArch(onlyPlatform), 'invalid platform-arch', onlyPlatform)
|
||||
platforms = platforms.filter(equals(onlyPlatform))
|
||||
platforms = platforms.filter((p) => p === onlyPlatform)
|
||||
}
|
||||
|
||||
la(platforms.length, 'no platforms to move', platforms)
|
||||
@@ -193,7 +194,7 @@ export const moveBinaries = async (args = []) => {
|
||||
console.log('Copying %s for commit %s',
|
||||
pluralize('last build', lastBuilds.length, true), releaseOptions.commit)
|
||||
|
||||
console.log(lastBuilds.map(prop('s3zipPath')).join('\n'))
|
||||
console.log(lastBuilds.map((v) => v.s3zipPath).join('\n'))
|
||||
|
||||
try {
|
||||
await prompts.shouldCopy()
|
||||
|
||||
@@ -2,10 +2,9 @@ const debug = require('debug')('cypress:binary')
|
||||
import la from 'lazy-ass'
|
||||
import is from 'check-more-types'
|
||||
import S3 from 'aws-sdk/clients/s3'
|
||||
import { prop, values, all } from 'ramda'
|
||||
|
||||
export const hasOnlyStringValues = (o) => {
|
||||
return all(is.unemptyString, values(o))
|
||||
return Object.values(o).every((v) => is.unemptyString(v))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,7 +66,7 @@ export const s3helpers = {
|
||||
debug('AWS result in %s %s', bucket, prefix)
|
||||
debug('%o', result)
|
||||
|
||||
resolve(result.CommonPrefixes.map(prop('Prefix')))
|
||||
resolve(result.CommonPrefixes.map((val) => val.Prefix))
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
@@ -8,8 +8,8 @@ const awspublish = require('gulp-awspublish')
|
||||
const rename = require('gulp-rename')
|
||||
const gulpDebug = require('gulp-debug')
|
||||
const gulp = require('gulp')
|
||||
const R = require('ramda')
|
||||
const hasha = require('hasha')
|
||||
const _ = require('lodash')
|
||||
|
||||
const uploadUtils = require('./util/upload')
|
||||
const {
|
||||
@@ -147,9 +147,8 @@ const uploadUniqueBinary = function (args = []) {
|
||||
})
|
||||
|
||||
console.log('Upload unique binary options')
|
||||
const pickOptions = R.pick(['file', 'version', 'hash'])
|
||||
|
||||
console.log(pickOptions(options))
|
||||
console.log(_.pick(options, ['file', 'version', 'hash']))
|
||||
|
||||
la(check.unemptyString(options.file), 'missing file to upload', options)
|
||||
la(isBinaryFile(options.file),
|
||||
|
||||
@@ -8,7 +8,6 @@ const retry = require('bluebird-retry')
|
||||
const la = require('lazy-ass')
|
||||
const check = require('check-more-types')
|
||||
const execa = require('execa')
|
||||
const R = require('ramda')
|
||||
const prettyMs = require('pretty-ms')
|
||||
const pluralize = require('pluralize')
|
||||
const debug = require('debug')('cypress:binary')
|
||||
@@ -39,7 +38,7 @@ const createCLIExecutable = (command) => {
|
||||
|
||||
return execa(command, args, { stdio: 'inherit', cwd, env })
|
||||
// if everything is ok, resolve with nothing
|
||||
.then(R.always(undefined))
|
||||
.then(() => undefined)
|
||||
.catch((result) => {
|
||||
const msg = `${commandToExecute} failed with exit code: ${result.code}`
|
||||
|
||||
|
||||
+15
-8
@@ -4,7 +4,6 @@ const execa = require('execa')
|
||||
const path = require('path')
|
||||
const la = require('lazy-ass')
|
||||
const fs = require('fs')
|
||||
const R = require('ramda')
|
||||
const filesize = require('filesize')
|
||||
|
||||
// prints disk usage numbers using "du" utility
|
||||
@@ -59,7 +58,7 @@ const macZip = (src, dest) => {
|
||||
|
||||
return execa(zip, options)
|
||||
.then(onZipFinished)
|
||||
.then(R.always(dest))
|
||||
.then(() => dest)
|
||||
.catch(onError)
|
||||
})
|
||||
}
|
||||
@@ -100,8 +99,12 @@ const linuxZipAction = function (parentFolder, dest, relativeSource) {
|
||||
|
||||
return execa(cmd, { shell: true })
|
||||
.then(onZipFinished)
|
||||
.then(R.always(dest))
|
||||
.then(R.tap(checkZipSize))
|
||||
.then(() => dest)
|
||||
.then((val) => {
|
||||
checkZipSize(val)
|
||||
|
||||
return val
|
||||
})
|
||||
.catch(onError)
|
||||
}
|
||||
|
||||
@@ -123,7 +126,7 @@ const renameFolder = function (src) {
|
||||
console.log(`renaming ${src} to ${renamed}`)
|
||||
|
||||
return fs.promises.rename(src, renamed)
|
||||
.then(R.always(renamed))
|
||||
.then(() => renamed)
|
||||
}
|
||||
|
||||
// resolves with zipped filename
|
||||
@@ -136,7 +139,7 @@ const linuxZip = function (src, dest) {
|
||||
return renameFolder(src)
|
||||
.then((renamedSource) => {
|
||||
return printFileSizes(renamedSource)
|
||||
.then(R.always(renamedSource))
|
||||
.then(() => renamedSource)
|
||||
}).then((renamedSource) => {
|
||||
console.log(`will zip folder ${renamedSource}`)
|
||||
const parentFolder = path.dirname(renamedSource)
|
||||
@@ -173,8 +176,12 @@ const windowsZipAction = function (src, dest) {
|
||||
|
||||
return execa(cmd, { shell: true })
|
||||
.then(onZipFinished)
|
||||
.then(R.always(dest))
|
||||
.then(R.tap(checkZipSize))
|
||||
.then(() => dest)
|
||||
.then((val) => {
|
||||
checkZipSize(val)
|
||||
|
||||
return val
|
||||
})
|
||||
.catch(onError)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user