Skip to content

Commit

Permalink
Merge branch '10.0-release' into tgriesser/feat/error-standarization
Browse files Browse the repository at this point in the history
* 10.0-release:
  fix: comment link to accurate docs (#20437)
  fix: scaffold commands file (#20398)
  fix(launchpad): support default export (#20383)
  feat(launchpad): support for Vue CLI 5 (#20413)
  fix: UNIFY-676 browsers should be configurable in setupNodeEvents (#20367)
  fix: make launchpad link open default browser (#20399)
  fix(icons): publish the files in the package
  fix: build icons in build-prod (#20411)
  test: migrate module-api to 10.0
  chore: build this branch
  test: migrate module_api to system tests (#20265)
  chore: remove pkg/driver //@ts-nocheck final (#20169)
  chore: fix "cannot find module" in clone-repo-and-checkout-release-branch (#20293)
  chore: Update Chrome (beta) to 99.0.4844.45 (#20234)
  chore: fix CI cache state for darwin (#20339)
  Add TODO comments
  feedback
  chore: move tests to its own file.
  • Loading branch information
tgriesser committed Mar 2, 2022
2 parents 918e111 + 0343de1 commit 08136ef
Show file tree
Hide file tree
Showing 116 changed files with 7,768 additions and 1,889 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ system-tests/projects/vueclivue2-configured/**/*
system-tests/projects/vueclivue3-unconfigured/**/*
system-tests/projects/vueclivue3-configured/**/*

system-tests/projects/vuecli5vue3-unconfigured/**/*
system-tests/projects/vuecli5vue3-configured/**/*

system-tests/projects/vue3-vite-ts-unconfigured/**/*
system-tests/projects/vue3-vite-ts-configured/**/*

Expand Down
15 changes: 0 additions & 15 deletions __snapshots__/bump-spec.js

This file was deleted.

2 changes: 1 addition & 1 deletion browser-versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"chrome:beta": "99.0.4844.27",
"chrome:beta": "99.0.4844.45",
"chrome:stable": "98.0.4758.102"
}
71 changes: 12 additions & 59 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
- fix-cache-state
- merge-develop-2-28-22

# 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 All @@ -39,7 +39,7 @@ macWorkflowFilters: &mac-workflow-filters
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ '10.0-release', << pipeline.git.branch >> ]
- equal: [ fix-cache-state, << pipeline.git.branch >> ]
- equal: [ merge-develop-2-28-22, << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand All @@ -49,7 +49,7 @@ windowsWorkflowFilters: &windows-workflow-filters
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ '10.0-release', << pipeline.git.branch >> ]
- equal: [ fix-cache-state, << pipeline.git.branch >> ]
- equal: [ merge-develop-2-28-22, << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -585,10 +585,16 @@ commands:
steps:
- restore_cached_binary
- run:
name: "Cloning test project: <<parameters.repo>>"
name: "Cloning test project and checking out release branch: <<parameters.repo>>"
working_directory: ~/
command: |
git clone --depth 1 --no-single-branch https://github.com/cypress-io/<<parameters.repo>>.git /tmp/<<parameters.repo>>
cd /tmp/<<parameters.repo>> && (git checkout $(node ./scripts/get-next-version.js) || true)
# install some deps for get-next-version
npm i [email protected] [email protected] [email protected]
NEXT_VERSION=$(node ./cypress/scripts/get-next-version.js)
cd /tmp/<<parameters.repo>> && (git checkout $NEXT_VERSION || true)
- when:
condition: <<parameters.pull_request_id>>
steps:
Expand Down Expand Up @@ -1663,7 +1669,7 @@ jobs:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "fix-cache-state" && "$CIRCLE_BRANCH" != "10.0-release" ]]; then
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "merge-develop-2-28-22" && "$CIRCLE_BRANCH" != "10.0-release" ]]; then
echo "Not uploading artifacts or posting install comment for this branch."
circleci-agent step halt
fi
Expand Down Expand Up @@ -1749,39 +1755,6 @@ jobs:
yarn cypress:run --project /tmp/cypress-test-tiny --record
- store-npm-logs

test-binary-and-npm-against-other-projects:
<<: *defaults
parameters:
<<: *defaultsParameters
resource_class:
type: string
default: medium
resource_class: << parameters.resource_class >>
steps:
# needs uploaded NPM and test binary
- restore_cached_workspace
- run: ls -la
# make sure JSON files with uploaded urls are present
- run: ls -la binary-url.json npm-package-url.json
- run: cat binary-url.json
- run: cat npm-package-url.json
- run:
# install NPM from unique urls
name: Install Cypress Binary in Dummy Package
command: |
node scripts/test-unique-npm-and-binary.js \
--npm npm-package-url.json \
--binary binary-url.json \
--cwd /tmp/testing
- run:
name: Running other test projects with new NPM package and binary
command: |
node scripts/test-other-projects.js \
--npm npm-package-url.json \
--binary binary-url.json \
--provider circle
- store-npm-logs

test-npm-module-and-verify-binary:
<<: *defaults
steps:
Expand Down Expand Up @@ -2364,11 +2337,6 @@ linux-workflow: &linux-workflow
- test-binary-against-kitchensink:
requires:
- create-build-artifacts
- test-binary-and-npm-against-other-projects:
context: test-runner:trigger-test-jobs
<<: *mainBuildFilters
requires:
- create-build-artifacts
- test-npm-module-and-verify-binary:
<<: *mainBuildFilters
requires:
Expand Down Expand Up @@ -2459,13 +2427,6 @@ mac-workflow: &mac-workflow
requires:
- darwin-build

- test-binary-and-npm-against-other-projects:
context: test-runner:trigger-test-jobs
name: darwin-test-binary-and-npm-against-other-projects
executor: mac
requires:
- darwin-create-build-artifacts

windows-workflow: &windows-workflow
jobs:
- node_modules_install:
Expand Down Expand Up @@ -2521,14 +2482,6 @@ windows-workflow: &windows-workflow
requires:
- windows-build

- test-binary-and-npm-against-other-projects:
context: test-runner:trigger-test-jobs
name: windows-test-binary-and-npm-against-other-projects
executor: windows
resource_class: windows.medium
requires:
- windows-create-build-artifacts

workflows:
linux:
<<: *linux-workflow
Expand Down
2 changes: 0 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
"build": "node ./scripts/build.js",
"dtslint": "dtslint types",
"postinstall": "node ./scripts/post-install.js",
"prerelease": "yarn build",
"release": "cd build && releaser --no-node --no-changelog",
"size": "t=\"cypress-v0.0.0.tgz\"; yarn pack --filename \"${t}\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";",
"test": "yarn test-unit",
"test-debug": "node --inspect-brk $(yarn bin mocha)",
Expand Down
38 changes: 22 additions & 16 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ declare namespace Cypress {
/**
* The configuration for Cypress.
*/
type Config = ResolvedConfigOptions & RuntimeConfigOptions
type Config = ResolvedConfigOptions & RuntimeConfigOptions & RuntimeServerConfigOptions

/**
* Several libraries are bundled with Cypress by default.
Expand Down Expand Up @@ -2898,7 +2898,7 @@ declare namespace Cypress {
*/
clientCertificates: ClientCertificate[]

/**
/**
* Handle Cypress plugins
*/
setupNodeEvents: (on: PluginEvents, config: PluginConfigOptions) => Promise<PluginConfigOptions> | PluginConfigOptions
Expand All @@ -2907,17 +2907,17 @@ declare namespace Cypress {
/**
* Options appended to config object on runtime.
*/
interface RuntimeConfigOptions {
interface RuntimeConfigOptions extends Partial<RuntimeServerConfigOptions> {
/**
* Absolute path to the config file (default: <projectRoot>/cypress.config.{ts|js}) or false
*/
configFile: string | false
/**
* CPU architecture, from Node `os.arch()`
*
* @see https://nodejs.org/api/os.html#os_os_arch
*/
arch: string
/**
* The browser Cypress is running on.
*/
browser: Browser
/**
* Available browsers found on your system.
*/
Expand Down Expand Up @@ -2946,21 +2946,31 @@ declare namespace Cypress {
*/
version: string

// Internal or Unlisted at server/lib/config_options
namespace: string
projectRoot: string
devServerPublicPathRoute: string
}

/**
* Optional options added before the server starts
*/
interface RuntimeServerConfigOptions {
/**
* The browser Cypress is running on.
*/
browser: Browser
// Internal or Unlisted at server/lib/config_options
autoOpen: boolean
browserUrl: string
clientRoute: string
configFile: string
cypressEnv: string
devServerPublicPathRoute: string
isNewProject: boolean
isTextTerminal: boolean
morgan: boolean
namespace: string
parentTestsFolder: string
parentTestsFolderDisplay: string
projectName: string
projectRoot: string
proxyUrl: string
remote: RemoteState
report: boolean
Expand Down Expand Up @@ -2997,11 +3007,7 @@ declare namespace Cypress {
*/
type ConfigOptions<ComponentDevServerOpts = any> = Partial<ResolvedConfigOptions<ComponentDevServerOpts>>

interface PluginConfigOptions extends ResolvedConfigOptions {
/**
* Absolute path to the config file (default: <projectRoot>/cypress.config.{ts|js}) or false
*/
configFile: string | false
interface PluginConfigOptions extends ResolvedConfigOptions, RuntimeConfigOptions {
/**
* Absolute path to the root of the project
*/
Expand Down
19 changes: 10 additions & 9 deletions cli/types/tests/plugins-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ const pluginConfig: Cypress.PluginConfig = (on, config) => {}
// allows synchronous returns
const pluginConfig2: Cypress.PluginConfig = (on, config) => {
config // $ExpectType PluginConfigOptions
config.baseUrl // $ExpectType: string
config.configFile // $ExpectType: string | false
config.fixturesFolder // $ExpectType: string | false
config.pluginsFile // $ExpectType: string | false
config.screenshotsFolder // $ExpectType: string | false
config.videoCompression // $ExpectType: number | false
config.projectRoot // $ExpectType: string
config.version // $ExpectType: string
config.testingType // $ExpectType: TestingType
config.baseUrl // $ExpectType string | null
config.configFile // $ExpectType string | false
config.fixturesFolder // $ExpectType string | false
config.pluginsFile // $ExpectType string | false
config.screenshotsFolder // $ExpectType string | false
config.videoCompression // $ExpectType number | false
config.projectRoot // $ExpectType string
config.version // $ExpectType string
config.testingType // $ExpectType TestingType
config.browsers // $ExpectType Browser[]

on('before:browser:launch', (browser, options) => {
browser.displayName // $ExpectType string
Expand Down
9 changes: 1 addition & 8 deletions guides/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,7 @@ In the following instructions, "X.Y.Z" is used to denote the [next version of Cy
- Go into a project, run a quick test, make sure things look right
- Install the new version into an established project and run the tests there
- [cypress-realworld-app](https://github.com/cypress-io/cypress-realworld-app) uses yarn and represents a typical consumer implementation.
- Optionally, do more thorough tests:
- Trigger test projects from the command line (if you have the appropriate permissions)
```shell
node scripts/test-other-projects.js --npm [email protected] --binary X.Y.Z
```
- Test the new version of Cypress against the Cypress dashboard repo.
- Optionally, do more thorough tests, for example test the new version of Cypress against the Cypress dashboard repo.
7. Confirm that every issue labeled [stage: pending release](https://github.com/cypress-io/cypress/issues?q=label%3A%22stage%3A+pending+release%22+is%3Aclosed) has a ZenHub release set. **Tip:** there is a command in [`release-automations`](https://github.com/cypress-io/release-automations)'s `issues-in-release` tool to list and check such issues. Without a ZenHub release issues will not be included in the right changelog.
Expand Down
32 changes: 4 additions & 28 deletions guides/testing-other-projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ In `develop`, `master`, and any other branch configured in [`circle.yml`](../cir

Two main strategies are used to spawn these test projects:

1. Local CI
1. `test-binary-against-repo` jobs
2. Remote CI

## Local CI
## `test-binary-against-repo` jobs

A number of CI jobs in `circle.yml` clone test projects and run tests as part of `cypress-io/cypress`'s CI pipeline.

Expand All @@ -17,30 +17,6 @@ Similarly to "Remote CI" test projects, Local CI test projects will attempt to c

One advantage to local CI is that it does not require creating commits to another repo.

## Remote CI
## `binary-system-tests`

After the production binary and NPM package are build and uploaded in CI, [`/scripts/test-other-projects.js`](../scripts/test-other-projects.js) is run as part of the `test-other-projects` `circle.yml` step.

This script creates commits inside of several test projects (hence "Remote CI") in order to trigger a realistic, continous-integration test of Cypress.

For a list of the projects, see the definition of `_PROVIDERS` in [`/scripts/binary/bump.js`](../scripts/binary/bump.js).

For each project and operating system combo in `_PROVIDERS`, the script:

1. Creates a commit to the test project's GitHub repo using the API. [An example of such a commit.](https://github.com/cypress-io/cypress-test-tiny/commit/5b39f3f43f6b7598f0d57cffcba71a7048d1d809)
* Note the commit is specifically for `linux`, and only the `linux-tests` job runs to completion.
* If a branch exists that is named after the [next version](./next-version.md) (`X.Y.Z`), the commit will be made to that branch.
* This is useful to test a release's breaking changes or new features against an example project without having to have the project's main branch in a broken state.
* Otherwise, the default branch is used for the commit.
2. Creates a status check in this GitHub repo (`cypress-io/cypress`) and marks it `pending`.
3. Waits for the test project's CI workflow to finish running.
* Each test project is configured to use [`@cypress/commit-message-install`](https://github.com/cypress-io/commit-message-install) to configure the exact test required via the information in the commit message.
* Each test project is configured to update the `pending` CI job in `cypress-io/cypress` to a `success` when the CI workflow successfully finishes.

These tests add coverage to the Cypress code base by:

* Providing a super-close-to-real-world usage of Cypress (i.e. installing fresh from an NPM package and running in a bare repo using the repo's CI setup)
* Testing in a variety of environments
* Different Node.js versions
* Different operating systems
* A multitude of CI providers
System tests in `/system-tests/test-binary` are run against the built Cypress App in CI. For more details, see the [README](../system-tests/README.md).
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"binary-zip": "node ./scripts/binary.js zip",
"build": "lerna run build --stream --no-bail --ignore create-cypress-tests --ignore \"'@packages/{runner}'\" && lerna run build --stream --scope create-cypress-tests",
"build-prod": "lerna run build-prod-ui --stream && lerna run build-prod --stream --ignore create-cypress-tests && lerna run build-prod --stream --scope create-cypress-tests",
"bump": "node ./scripts/binary.js bump",
"check-node-version": "node scripts/check-node-version.js",
"check-terminal": "node scripts/check-terminal.js",
"clean": "lerna run clean --parallel --no-bail || echo 'ok, errors while cleaning'",
Expand Down Expand Up @@ -76,7 +75,6 @@
"nvm": "0.0.4"
},
"devDependencies": {
"@cypress/bumpercar": "2.0.12",
"@cypress/commit-message-install": "3.1.3",
"@cypress/env-or-json-file": "2.0.0",
"@cypress/github-commit-status-check": "1.5.0",
Expand Down Expand Up @@ -188,15 +186,13 @@
"lint-staged": "11.1.2",
"listr2": "3.8.3",
"lodash": "^4.17.21",
"make-empty-github-commit": "https://github.com/cypress-io/make-empty-github-commit.git#4a592aedb776ba2f4cc88979055315a53eec42ee",
"minimist": "1.2.5",
"mocha": "3.5.3",
"mocha-banner": "1.1.2",
"mocha-junit-reporter": "2.0.0",
"mocha-multi-reporters": "1.1.7",
"mock-fs": "5.1.1",
"p-defer": "^3.0.0",
"parse-github-repo-url": "1.4.1",
"patch-package": "6.4.7",
"plist": "3.0.4",
"pluralize": "8.0.0",
Expand Down
Loading

0 comments on commit 08136ef

Please sign in to comment.