mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-22 23:20:24 -05:00
Copy test runner binaries before releasing new version (#4082)
* adding S3 sdk * test binary folder * linting * before searching for binary * linting * grab folders in the given S3 prefix * grab folders in the given S3 prefix * find the last build * found last builds for commit * refactoring * add tests for upload dir name * create destination zip filename * copying S3 files * move s3 helpers into own object, prepare for testing * add realistic test * linting * chore: add documentation to DEPLOY.md file
This commit is contained in:
@@ -1,22 +1,61 @@
|
||||
const snapshot = require('snap-shot-it')
|
||||
|
||||
/* eslint-env mocha */
|
||||
describe('getCDN', () => {
|
||||
context('binary', () => {
|
||||
const { getCDN } = require('../../binary/upload-unique-binary')
|
||||
describe('upload-unique-binary', () => {
|
||||
describe('getUploadDirName', () => {
|
||||
const { getUploadDirName } = require('../../binary/upload-unique-binary')
|
||||
|
||||
it('returns CDN s3 path', () => {
|
||||
it('returns folder for given version', () => {
|
||||
const options = {
|
||||
platform: 'darwin-x64',
|
||||
filename: 'cypress.zip',
|
||||
platformArch: 'darwin-x64',
|
||||
version: '3.3.0',
|
||||
// ci name + commit sha + build number
|
||||
hash: 'ci-name-e154a40f3f76abd39a1d85c0ebc0ff9565015706-123',
|
||||
}
|
||||
|
||||
snapshot({
|
||||
snapshot('upload binary folder', {
|
||||
input: options,
|
||||
result: getCDN(options),
|
||||
result: getUploadDirName(options),
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('getUploadDirForPlatform', () => {
|
||||
const {
|
||||
getUploadDirForPlatform,
|
||||
} = require('../../binary/upload-unique-binary')
|
||||
|
||||
it('returns folder for given version and platform', () => {
|
||||
const options = {
|
||||
platformArch: 'darwin-x64',
|
||||
version: '3.3.0',
|
||||
}
|
||||
const result = getUploadDirForPlatform(options, options.platformArch)
|
||||
|
||||
snapshot('upload binary folder for platform', {
|
||||
input: options,
|
||||
result,
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('getCDN', () => {
|
||||
context('binary', () => {
|
||||
const { getCDN } = require('../../binary/upload-unique-binary')
|
||||
|
||||
it('returns CDN s3 path', () => {
|
||||
const options = {
|
||||
platform: 'darwin-x64',
|
||||
filename: 'cypress.zip',
|
||||
version: '3.3.0',
|
||||
// ci name + commit sha + build number
|
||||
hash: 'ci-name-e154a40f3f76abd39a1d85c0ebc0ff9565015706-123',
|
||||
}
|
||||
|
||||
snapshot('getCDN for binary', {
|
||||
input: options,
|
||||
result: getCDN(options),
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user