Skip to content

Commit

Permalink
Merge branch 'develop' into tgriesser/chore/refactor-errors
Browse files Browse the repository at this point in the history
* develop:
  chore: fix cypress npm package artifact upload path (#20023)
  chore(driver): move cy.within logic into it's own file (#20036)
  chore: update automerge workflows (#19982)
  fix(selectFile): use target window's File/DataTransfer classes (#20003)
  chore: Update Chrome (stable) to 98.0.4758.80 and Chrome (beta) to 98.0.4758.80 (#19995)
  fix: Adjust ffmpeg CLI args for performance (#19983)
  build: allow unified to run cypress on Apple Silicon (arm64) (backport #19067 to 9.x) (#19968)
  • Loading branch information
tgriesser authored and brian-mann committed Feb 5, 2022
1 parent 7e9468d commit 9995f25
Show file tree
Hide file tree
Showing 34 changed files with 887 additions and 1,119 deletions.
78 changes: 0 additions & 78 deletions .github/workflows/merge-develop-into-10.0-release.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/merge-master-into-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
# the default `GITHUB_TOKEN` cannot push to protected branches, so use `cypress-app-bot`'s token instead
token: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Set committer info
run: |
git config --local user.email "$(git log --format='%ae' HEAD^!)"
Expand Down
9 changes: 0 additions & 9 deletions __snapshots__/upload-npm-package-spec.js

This file was deleted.

26 changes: 0 additions & 26 deletions __snapshots__/upload-unique-binary-spec.js

This file was deleted.

Binary file added assets/cypress-bot-pre-release-comment.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions browser-versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"chrome:beta": "98.0.4758.74",
"chrome:stable": "97.0.4692.99"
"chrome:beta": "98.0.4758.80",
"chrome:stable": "98.0.4758.80"
}
56 changes: 21 additions & 35 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mainBuildFilters: &mainBuildFilters
only:
- develop
- 10.0-release
- node-17-maybe
- fix-ci-artifact-uploads

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand Down Expand Up @@ -525,10 +525,6 @@ commands:
post-install-comment:
description: Post GitHub comment with a blurb on how to install pre-release version
steps:
- run: ls -la
- run: ls -la binary-url.json npm-package-url.json
- run: cat binary-url.json
- run: cat npm-package-url.json
- run:
name: Post pre-release install comment
command: |
Expand Down Expand Up @@ -862,6 +858,7 @@ commands:
echo "Not code signing for this platform"
fi
- run:
name: Build the Cypress binary
environment:
DEBUG: electron-builder,electron-osx-sign*
# notarization on Mac can take a while
Expand All @@ -871,42 +868,25 @@ commands:
yarn binary-build --platform $PLATFORM --version $(node ./scripts/get-next-version.js)
- run:
name: Zip the binary
command: |
yarn binary-zip --platform $PLATFORM
command: yarn binary-zip --platform $PLATFORM
- store-npm-logs
- persist_to_workspace:
root: ~/
paths:
- cypress/cypress.zip

upload-binary:
steps:
- run:
name: upload unique binary
command: |
node scripts/binary.js upload-unique-binary \
--file cypress.zip \
--version $(node -p "require('./package.json').version")
- run: cat binary-url.json
- store-npm-logs
- persist_to_workspace:
root: ~/
paths:
- cypress/binary-url.json

build-cypress-npm-package:
parameters:
executor:
type: executor
default: cy-doc
steps:
- run:
name: bump NPM version
name: Bump NPM version
command: yarn get-next-version --npm
- run:
name: build NPM package
command: |
yarn build --scope cypress
name: Build NPM package
command: yarn build --scope cypress
- run:
command: ls -la types
working_directory: cli/build
Expand All @@ -925,27 +905,36 @@ commands:
name: list created NPM package
command: ls -l
- store-npm-logs
- run: pwd
- persist_to_workspace:
root: ~/
paths:
- cypress/cypress.tgz

upload-npm-package:
upload-build-artifacts:
steps:
- run: ls -l
- run:
name: upload NPM package
name: Upload unique binary to S3
command: |
node scripts/binary.js upload-npm-package \
node scripts/binary.js upload-build-artifact \
--type binary \
--file cypress.zip \
--version $(node -p "require('./package.json').version")
- run:
name: Upload NPM package to S3
command: |
node scripts/binary.js upload-build-artifact \
--type npm-package \
--file cypress.tgz \
--version $(node -p "require('./package.json').version")
- store-npm-logs
- run: ls -l
- run: cat binary-url.json
- run: cat npm-package-url.json
- persist_to_workspace:
root: ~/
paths:
- cypress/binary-url.json
- cypress/npm-package-url.json

jobs:
Expand Down Expand Up @@ -1590,12 +1579,11 @@ jobs:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "node-17-maybe" ]]; then
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "fix-ci-artifact-uploads" ]]; then
echo "Not uploading artifacts or posting install comment for this branch."
circleci-agent step halt
fi
- upload-binary
- upload-npm-package
- upload-build-artifacts
- post-install-comment

test-kitchensink:
Expand Down Expand Up @@ -2131,7 +2119,6 @@ linux-workflow: &linux-workflow
- runner-ct-integration-tests-chrome:
requires:
- build

- desktop-gui-integration-tests-7x:
requires:
- build
Expand Down Expand Up @@ -2193,7 +2180,6 @@ linux-workflow: &linux-workflow
- npm-react
- npm-mount-utils
- npm-vue
- npm-design-system
- npm-webpack-batteries-included-preprocessor
- npm-webpack-preprocessor
- npm-vite-dev-server
Expand Down
2 changes: 1 addition & 1 deletion cli/lib/tasks/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const getVersionSpecifier = (startDir = path.resolve(__dirname, '../..')) => {
})
}

const betaNpmUrlRe = /^\/beta\/npm\/(?<version>[0-9.]+)\/(?<artifactSlug>.+?)\/cypress\.tgz$/
const betaNpmUrlRe = /^\/beta\/npm\/(?<version>[0-9.]+)\/(?<platformSlug>.+?)\/(?<artifactSlug>.+?)\/cypress\.tgz$/

// convert a prerelease NPM package .tgz URL to the corresponding binary .zip URL
const getBinaryUrlFromPrereleaseNpmUrl = (npmUrl) => {
Expand Down
6 changes: 3 additions & 3 deletions cli/test/lib/tasks/install_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,13 @@ describe('/lib/tasks/install', function () {
})

it('returns binary url for prerelease npm url', function () {
expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/ciprovider-branchname-sha/cypress.tgz'))
expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/linux-x64/ciprovider-branchname-sha/cypress.tgz'))
.to.eq('https://cdn.cypress.io/beta/binary/5.1.1/linux-x64/ciprovider-branchname-sha/cypress.zip')

expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/circle-develop-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.tgz'))
expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/inux-x64/circle-develop-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.tgz'))
.to.eq('https://cdn.cypress.io/beta/binary/5.1.1/linux-x64/circle-develop-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.zip')

expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/circle-develop/some/branch-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.tgz'))
expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/inux-x64/circle-develop/some/branch-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.tgz'))
.to.eq('https://cdn.cypress.io/beta/binary/5.1.1/linux-x64/circle-develop/some/branch-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.zip')
})

Expand Down
17 changes: 6 additions & 11 deletions guides/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,7 @@ of Cypress. You can see the progress of the test projects by opening the status

![Screenshot of status checks](https://i.imgur.com/AsQwzgO.png)

#### :bangbang: Important :bangbang:

The `linux x64`, `win32 x64`, and `darwin x64` artifacts produced by CI are all placed in the same directory on the CDN. The version that was built last will overwrite the other versions in the directory. Until work is done to complete [#19771](https://github.com/cypress-io/cypress/issues/19771), you must ensure that the `linux` workflow publishes its artifacts **after** the `windows`/`mac` workflows. To guarantee this, you can re-run the `create-build-artifacts` job for the `linux` workflow within CircleCI after the initial builds have completed.

<img src="https://user-images.githubusercontent.com/1711637/150612076-ac1d233b-519a-443b-9fd4-950a8f0439ef.png" width="250" height="auto">

Once the `develop` branch for all test projects are reliably passing with the new changes and the `linux` binary is present at `https://cdn.cypress.io/beta/npm/X.Y.Z/<sha>/cypress.tgz`, publishing can proceed.
Once the `develop` branch for all test projects are reliably passing with the new changes and the `linux-x64` binary is present at `https://cdn.cypress.io/beta/binary/X.Y.Z/linux-x64/<sha>/cypress.zip`, and the `linux-x64` cypress npm package is present at `https://cdn.cypress.io/beta/binary/X.Y.Z/linux-x64/<sha>/cypress.tgz`, publishing can proceed.

### Steps to Publish a New Version

Expand All @@ -93,14 +87,15 @@ In the following instructions, "X.Y.Z" is used to denote the [next version of Cy
- To find the link to the package file `cypress.tgz`:
1. In GitHub, go to the latest commit (the one whose sha you used in the last step).
![commit-link](https://user-images.githubusercontent.com/1157043/80608728-33fe6100-8a05-11ea-8b53-375303757b67.png)
2. Scroll down past the changes to the comments. The first comment should be a `cypress-bot` comment that includes a line beginning `npm install ...`. Grab the `https://cdn.../npm/X.Y.Z/<long sha>/cypress.tgz` link.
![cdn-tgz-link](https://user-images.githubusercontent.com/1157043/80608736-3791e800-8a05-11ea-8d75-e4f80128e857.png)
- Make sure the linux binaries are present at that location. See [Before Publishing a New Version](#before-publishing-a-new-version).
- Publish to the npm registry straight from the URL:
2. Scroll down past the changes to the comments. The first comment should be a `cypress-bot` comment that includes a line beginning `npm install ...`. Grab the `https://cdn.../npm/X.Y.Z/<platform>/<long sha>/cypress.tgz` link.
![commit-bot-comment](../assets/cypress-bot-pre-release-comment.png)
- Make sure the `linux-x64` binary and npm package are present at the commented locations. See [Before Publishing a New Version](#before-publishing-a-new-version).
- Publish the `linux-x64` distribution to the npm registry straight from the URL:

```shell
npm publish https://cdn.cypress.io/beta/npm/X.Y.Z/<long sha>/cypress.tgz --tag dev
```
:bangbang: Important :bangbang: Be sure to release the `linux-x64` distribution.

5. Double-check that the new version has been published under the `dev` tag using `npm info cypress` or [available-versions](https://github.com/bahmutov/available-versions). `latest` should still point to the previous version. Example output:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,18 @@ describe('src/cy/commands/actions/selectFile', () => {
})
})

it('uses the AUT\'s File constructor', () => {
cy.window().then(($autWindow) => {
cy.get('#basic').selectFile('@foo', { action: 'select' }).then((input) => {
expect(input[0].files[0]).to.be.instanceOf($autWindow.File)
})

cy.get('#basic').selectFile('@foo', { action: 'drag-drop' }).then((input) => {
expect(input[0].files[0]).to.be.instanceOf($autWindow.File)
})
})
})

describe('shorthands', () => {
const validJsonString = `{
"foo": 1,
Expand Down

0 comments on commit 9995f25

Please sign in to comment.