Skip to content

Commit

Permalink
chore: updating v8 snapshot cache
Browse files Browse the repository at this point in the history
  • Loading branch information
cypress-bot[bot] committed Sep 29, 2023
1 parent 68711ed commit 95cc079
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 68 deletions.
4 changes: 2 additions & 2 deletions browser-versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"chrome:beta": "118.0.5993.11",
"chrome:stable": "117.0.5938.88",
"chrome:beta": "118.0.5993.21",
"chrome:stable": "117.0.5938.132",
"chrome:minimum": "64.0.3282.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const browser = require('webextension-polyfill')
const { cookieMatches } = require('@packages/server/lib/automation/util')

const client = require('./client')
const util = require('../lib/util')
const util = require('../../lib/util')

const COOKIE_PROPS = ['url', 'name', 'path', 'secure', 'domain']
const GET_ALL_PROPS = COOKIE_PROPS.concat(['session', 'storeId'])
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions packages/extension/app/v3/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "Cypress",
"description": "Adds Themes for testing with Cypress",
"applications": {
"gecko": {
"id": "[email protected]"
}
},
"permissions": [],
"icons": {
"16": "icons/icon_16x16.png",
"48": "icons/icon_48x48.png",
"128": "icons/icon_128x128.png"
},
"browser_action": {
"default_title": "Cypress",
"default_icon": {
"19": "icons/icon_19x19.png",
"38": "icons/icon_38x38.png"
},
"default_popup": "popup.html"
},
"chrome_url_overrides": {
"newtab": "newtab.html"
},
"manifest_version": 3,
"version": "0.0.0"
}
23 changes: 15 additions & 8 deletions packages/extension/gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ const clean = (done) => {
rimraf('dist', done)
}

const manifest = () => {
return gulp.src('app/manifest.json')
.pipe(gulp.dest('dist'))
const manifest = (v: 'v2' | 'v3') => {
return () => {
return gulp.src(`app/${v}/manifest.json`)
.pipe(gulp.dest(`dist/${v}`))
}
}

const background = (cb) => {
Expand All @@ -29,12 +31,14 @@ const background = (cb) => {

const html = () => {
return gulp.src('app/**/*.html')
.pipe(gulp.dest('dist'))
.pipe(gulp.dest('dist/v2'))
.pipe(gulp.dest('dist/v3'))
}

const css = () => {
return gulp.src('app/**/*.css')
.pipe(gulp.dest('dist'))
.pipe(gulp.dest('dist/v2'))
.pipe(gulp.dest('dist/v3'))
}

const icons = async () => {
Expand All @@ -47,7 +51,8 @@ const icons = async () => {
cyIcons.getPathToIcon('icon_48x48.png'),
cyIcons.getPathToIcon('icon_128x128.png'),
])
.pipe(gulp.dest('dist/icons'))
.pipe(gulp.dest('dist/v2/icons'))
.pipe(gulp.dest('dist/v3/icons'))
}

const logos = async () => {
Expand All @@ -57,15 +62,17 @@ const logos = async () => {
return gulp.src([
cyIcons.getPathToLogo('cypress-bw.png'),
])
.pipe(gulp.dest('dist/logos'))
.pipe(gulp.dest('dist/v2/logos'))
.pipe(gulp.dest('dist/v3/logos'))
}

const build = gulp.series(
clean,
gulp.parallel(
icons,
logos,
manifest,
manifest('v2'),
manifest('v3'),
background,
html,
css,
Expand Down
6 changes: 5 additions & 1 deletion packages/extension/lib/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ const fs = Promise.promisifyAll(require('fs'))

module.exports = {
getPathToExtension (...args) {
args = [__dirname, '..', 'dist'].concat(args)
args = [__dirname, '..', 'dist', 'v2'].concat(args)

return path.join.apply(path, args)
},

getPathToV3Extension (...args) {
return path.join(...[__dirname, '..', 'dist', 'v3', ...args])
},

getPathToTheme () {
return path.join(__dirname, '..', 'theme')
},
Expand Down
4 changes: 2 additions & 2 deletions packages/extension/test/integration/background_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const http = require('http')
const socket = require('@packages/socket')
const Promise = require('bluebird')
const mockRequire = require('mock-require')
const client = require('../../app/client')
const client = require('../../app/v2/client')

const browser = {
cookies: {
Expand Down Expand Up @@ -48,7 +48,7 @@ const browser = {

mockRequire('webextension-polyfill', browser)

const background = require('../../app/background')
const background = require('../../app/v2/background')
const { expect } = require('chai')

const PORT = 12345
Expand Down
19 changes: 14 additions & 5 deletions packages/extension/test/unit/extension_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,25 @@ describe('Extension', () => {
})

context('.getPathToExtension', () => {
it('returns path to dist', () => {
it('returns path to dist/v2', () => {
const result = extension.getPathToExtension()
const expected = path.join(cwd, 'dist')
const expected = path.join(cwd, 'dist', 'v2')

expect(path.normalize(result)).to.eq(path.normalize(expected))
})

it('returns path to files in dist', () => {
it('returns path to files in dist/v2', () => {
const result = extension.getPathToExtension('background.js')
const expected = path.join(cwd, '/dist/background.js')
const expected = path.join(cwd, '/dist/v2/background.js')

expect(path.normalize(result)).to.eq(path.normalize(expected))
})
})

context('.getPathToV3Extension', () => {
it('returns path to dist/v3', () => {
const result = extension.getPathToV3Extension()
const expected = path.join(cwd, 'dist', 'v3')

expect(path.normalize(result)).to.eq(path.normalize(expected))
})
Expand Down Expand Up @@ -113,7 +122,7 @@ describe('Extension', () => {

context('manifest', () => {
it('has a key that resolves to the static extension ID', () => {
return fs.readJsonAsync(path.join(cwd, 'app/manifest.json'))
return fs.readJsonAsync(path.join(cwd, 'app/v2/manifest.json'))
.then((manifest) => {
const cmd = `echo \"${manifest.key}\" | openssl base64 -d -A | shasum -a 256 | head -c32 | tr 0-9a-f a-p`

Expand Down
4 changes: 2 additions & 2 deletions packages/extension/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const webpack = require('webpack')

module.exports = {
mode: process.env.NODE_ENV || 'development',
entry: './app/init.js',
entry: './app/v2/init.js',
// https://github.com/cypress-io/cypress/issues/15032
// Default webpack output setting is "eval".
// Chrome doesn't allow "eval" inside extensions.
Expand All @@ -22,7 +22,7 @@ module.exports = {
},
output: {
filename: 'background.js',
path: path.resolve(__dirname, 'dist'),
path: path.resolve(__dirname, 'dist', 'v2'),
},
plugins: [
new webpack.DefinePlugin({
Expand Down
7 changes: 1 addition & 6 deletions packages/server/lib/browsers/chrome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type ChromePreferences = {
localState: object
}

const pathToExtension = extension.getPathToExtension()
const pathToExtension = extension.getPathToV3Extension()
const pathToTheme = extension.getPathToTheme()

// Common Chrome Flags for Automation
Expand Down Expand Up @@ -357,15 +357,10 @@ export = {
return
}

// get the string bytes for the final extension file
const str = await extension.setHostAndPath(options.proxyUrl, options.socketIoRoute)
const extensionDest = utils.getExtensionDir(browser, options.isTextTerminal)
const extensionBg = path.join(extensionDest, 'background.js')

// copy the extension src to the extension dist
await utils.copyExtension(pathToExtension, extensionDest)
await fs.chmod(extensionBg, 0o0644)
await fs.writeFileAsync(extensionBg, str)

return extensionDest
},
Expand Down
39 changes: 0 additions & 39 deletions packages/server/test/unit/browsers/chrome_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ require('../../spec_helper')

const os = require('os')
const mockfs = require('mock-fs')
const path = require('path')
const _ = require('lodash')

const extension = require('@packages/extension')
const launch = require('@packages/launcher/lib/browsers')
Expand Down Expand Up @@ -258,43 +256,6 @@ describe('lib/browsers/chrome', () => {
})
})

it('install extension and ensure write access', function () {
mockfs({
[path.resolve(`${__dirname }../../../../../extension/dist`)]: {
'background.js': mockfs.file({
mode: 0o0444,
}),
},
})

const getFile = function (path) {
return _.reduce(_.compact(_.split(path, '/')), (acc, item) => {
return acc.getItem(item)
}, mockfs.getMockRoot())
}

chrome._writeExtension.restore()
utils.getProfileDir.restore()

const profilePath = '/home/foo/snap/chromium/current'
const fullPath = `${profilePath}/Cypress/chromium-stable/interactive`

this.readJson.withArgs(`${fullPath}/Default/Preferences`).rejects({ code: 'ENOENT' })
this.readJson.withArgs(`${fullPath}/Default/Secure Preferences`).rejects({ code: 'ENOENT' })
this.readJson.withArgs(`${fullPath}/Local State`).rejects({ code: 'ENOENT' })

return chrome.open({
isHeadless: false,
isHeaded: false,
profilePath,
name: 'chromium',
channel: 'stable',
}, 'http://', openOpts, this.automation)
.then(() => {
expect((getFile(fullPath).getMode()) & 0o0700).to.be.above(0o0500)
})
})

it('cleans up an unclean browser profile exit status', function () {
this.readJson.withArgs('/profile/dir/Default/Preferences').resolves({
profile: {
Expand Down
2 changes: 1 addition & 1 deletion packages/server/test/unit/browsers/firefox_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ describe('lib/browsers/firefox', () => {
}

mockfs({
[path.resolve(`${__dirname }../../../../../extension/dist`)]: {
[path.resolve(`${__dirname }../../../../../extension/dist/v2`)]: {
'background.js': mockfs.file({
mode: 0o444,
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/server/test/unit/socket_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe('lib/socket', () => {
},
}

extensionBackgroundPage = require('@packages/extension/app/background')
extensionBackgroundPage = require('@packages/extension/app/v2/background')
})

beforeEach(function (done) {
Expand Down

3 comments on commit 95cc079

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 95cc079 Sep 29, 2023

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.3.1/linux-x64/update-v8-snapshot-cache-on-develop-95cc079298c4fc0d884e1998ba0ebd2e48c2c59f/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 95cc079 Sep 29, 2023

Choose a reason for hiding this comment

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

Circle has built the darwin 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.3.1/darwin-x64/update-v8-snapshot-cache-on-develop-95cc079298c4fc0d884e1998ba0ebd2e48c2c59f/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 95cc079 Sep 29, 2023

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.3.1/win32-x64/update-v8-snapshot-cache-on-develop-95cc079298c4fc0d884e1998ba0ebd2e48c2c59f/cypress.tgz

Please sign in to comment.