Skip to content

Commit

Permalink
Merge pull request #27020 from cypress-io/v13-develop-merge
Browse files Browse the repository at this point in the history
chore: merge develop into V13
  • Loading branch information
AtofStryker authored Jun 13, 2023
2 parents 458db1c + 6775d77 commit a5141a5
Show file tree
Hide file tree
Showing 19 changed files with 470 additions and 201 deletions.
11 changes: 6 additions & 5 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ mainBuildFilters: &mainBuildFilters
- /^release\/\d+\.\d+\.\d+$/
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- 'update-v8-snapshot-cache-on-develop'
- 'billg/v13-merge/6-8-23'
- 'matth/feat/chrome-headless'
- 'lmiller/fix-windows-regressions'

# 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 @@ -41,7 +42,7 @@ macWorkflowFilters: &darwin-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'billg/v13-merge/6-8-23', << pipeline.git.branch >> ]
- equal: [ 'matth/feat/chrome-headless', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -52,7 +53,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'billg/v13-merge/6-8-23', << pipeline.git.branch >> ]
- equal: [ 'matth/feat/chrome-headless', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -72,7 +73,7 @@ windowsWorkflowFilters: &windows-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'billg/v13-merge/6-8-23', << pipeline.git.branch >> ]
- equal: [ 'matth/feat/chrome-headless', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -139,7 +140,7 @@ commands:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "update-v8-snapshot-cache-on-develop" && "$CIRCLE_BRANCH" != "billg/v13-merge/6-8-23" ]]; then
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "update-v8-snapshot-cache-on-develop" && "$CIRCLE_BRANCH" != "lmiller/fix-windows-regressions" ]]; then
echo "Not uploading artifacts or posting install comment for this branch."
circleci-agent step halt
fi
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/report_weekly_app_kpis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: 'KPI Report Generation'
on:
# makes this workflow reusable
workflow_call:
secrets:
TRIAGE_BOARD_TOKEN:
required: true

workflow_dispatch:
inputs:
start-date:
description: 'Beginning date of query (ex. 2023-06-01)'
required: false
end-date:
description: 'Ending date of query (ex. 2023-06-01)'
required: false
default-other-repos:
description: "Comma separated list of repos you want to query"
required: false
default: '["cypress-documentation", "circleci-orb", "github-action", "cypress-docker-images", "cypress-chrome-recorder-extension", "cypress-chrome-recorder", "cypress-recorder-extension", "cypress-example-kitchensink", "cypress-origin-providers", "release-automations", "cypress-test-tiny", "eslint-plugin-cypress", "netlify-plugin-cypress", "cypress-support-internal", "cypress-realworld-app", "code-coverage"]'
default-mono-repo:
description: "The Cypress mono repo"
required: false
default: '["cypress"]'

schedule:
- cron: '0 18 * * 5' # this will run weekly on Friday at 2PM EST (the github workflow runners are on UTC)

jobs:
run-kpi-reporting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: 'cypress-io/release-automations'
ref: 'master'
ssh-key: ${{ secrets.WORKFLOW_DEPLOY_KEY }}
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Generate Non-mono Repo Open / Closed KPIs
uses: actions/github-script@v6
env:
DEFAULT_REPOS: ${{ github.event.inputs.default-other-repos || '["cypress-documentation", "circleci-orb", "github-action", "cypress-docker-images", "cypress-chrome-recorder-extension", "cypress-chrome-recorder", "cypress-recorder-extension", "cypress-example-kitchensink", "cypress-origin-providers", "release-automations", "cypress-test-tiny", "eslint-plugin-cypress", "netlify-plugin-cypress", "cypress-support-internal", "cypress-realworld-app", "code-coverage"]' }}
with:
github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }}
script: |
const script = require('./scripts/reports/open-vs-closed-issues.js')
await script.getOpenAndClosedIssueMetrics(github, context, ${{ env.DEFAULT_REPOS }});
- name: Generate Cypress Mono Repo Open / Closed KPIs
uses: actions/github-script@v6
env:
DEFAULT_MONO_REPO: ${{ github.event.inputs.default-mono-repo || '["cypress"]' }}
with:
github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }}
script: |
const script = require('./scripts/reports/open-vs-closed-issues.js')
await script.getOpenAndClosedIssueMetrics(github, context, ${{ env.DEFAULT_MONO_REPO }});
- name: Generate Triage Throughput KPIs
uses: actions/github-script@v6
env:
START_DATE: ${{ github.event.inputs.start-date }}
END_DATE: ${{ github.event.inputs.end-date }}
PROJECT_BOARD_NUMBER: 9
with:
github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }}
script: |
const script = require('./scripts/reports/triage_throughput_kpis.js')
await script.getTriageIssueMetrics(github, context, "${{ env.START_DATE }}", "${{ env.END_DATE }}", "${{ env.PROJECT_BOARD_NUMBER }}");
114 changes: 0 additions & 114 deletions .github/workflows/triage_issue_metrics.yml

This file was deleted.

7 changes: 6 additions & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,23 @@ _Released 03/1/2023 (PENDING)_

- The [`cy.readFile()`](/api/commands/readfile) command is now retry-able as a [query command](https://on.cypress.io/retry-ability). This should not affect any tests using it; the functionality is unchanged. However, it can no longer be overwritten using [`Cypress.Commands.overwrite()`](/api/cypress-api/custom-commands#Overwrite-Existing-Commands). Addressed in [#25595](https://github.com/cypress-io/cypress/pull/25595).

## 12.14.1
## 12.15.0

_Released 06/20/2023 (PENDING)_

**Features:**

- Added support for running Cypress tests with [Chrome's new `--headless=new` flag](https://developer.chrome.com/articles/new-headless/). Chrome versions 112 and above will now be run in the `headless` mode that matches the `headed` browser implementation. Addresses [#25972](https://github.com/cypress-io/cypress/issues/25972).
- The [`videoCompression`](https://docs.cypress.io/guides/references/configuration#Videos) configuration option now accepts both a boolean or a Constant Rate Factor (CRF) number between `1` and `51`. The `videoCompression` default value is still `32` CRF and when `videoCompression` is set to `true` the default of `32` CRF will be used. Addresses [#26658](https://github.com/cypress-io/cypress/issues/26658).

**Bugfixes:**

- Fixed an issue where video output was not being logged to the console when `videoCompression` was turned off. Videos will now log to the terminal regardless of the compression value. Addresses [#25945](https://github.com/cypress-io/cypress/issues/25945).

**Dependency Updates:**

- Removed [`@cypress/mocha-teamcity-reporter`](https://www.npmjs.com/package/@cypress/mocha-teamcity-reporter) as this package was no longer being referenced. Addressed in [#26938](https://github.com/cypress-io/cypress/pull/26938).

## 12.14.0

_Released 06/07/2023_
Expand Down
2 changes: 1 addition & 1 deletion packages/app/cypress/e2e/cypress-in-cypress.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ describe('Cypress in Cypress', { viewportWidth: 1500, defaultCommandTimeout: 100

cy.withCtx(async (ctx) => {
const url = `http://127.0.0.1:${ctx.gqlServerPort}/__launchpad/graphql?`
const payload = `{"query":"mutation{\\nrunSpec(specPath:\\"cypress/e2e/dom-content.spec.js\\"){\\n__typename\\n... on RunSpecResponse{\\ntestingType\\nbrowser{\\nid\\nname\\n}\\nspec{\\nid\\nname\\n}\\n}\\n}\\n}","variables":null}`
const payload = `{"query":"mutation{\\nrunSpec(specPath:\\"${ctx.currentProject}/cypress/e2e/dom-content.spec.js\\"){\\n__typename\\n... on RunSpecResponse{\\ntestingType\\nbrowser{\\nid\\nname\\n}\\nspec{\\nid\\nname\\n}\\n}\\n}\\n}","variables":null}`

ctx.coreData.app.browserStatus = 'open'

Expand Down
21 changes: 11 additions & 10 deletions packages/data-context/src/actions/ProjectActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,26 +512,27 @@ export class ProjectActions {

let targetTestingType: TestingType

// Get relative path from the specPath to determine which testing type from the specPattern
const relativeSpecPath = path.relative(this.ctx.currentProject, specPath)

// Check to see whether input specPath matches the specPattern for one or the other testing type
// If it matches neither then we can't run the spec and we should error
if (await this.ctx.project.matchesSpecPattern(specPath, 'e2e')) {
if (await this.ctx.project.matchesSpecPattern(relativeSpecPath, 'e2e')) {
targetTestingType = 'e2e'
} else if (await this.ctx.project.matchesSpecPattern(specPath, 'component')) {
} else if (await this.ctx.project.matchesSpecPattern(relativeSpecPath, 'component')) {
targetTestingType = 'component'
} else {
throw new RunSpecError('NO_SPEC_PATTERN_MATCH', 'Unable to determine testing type, spec does not match any configured specPattern')
}

debug(`Spec %s matches '${targetTestingType}' pattern`, specPath)

const absoluteSpecPath = this.ctx.path.resolve(this.ctx.currentProject, specPath)

debug('Attempting to launch spec %s', absoluteSpecPath)
debug('Attempting to launch spec %s', specPath)

// Look to see if there's actually a file at the target location
// This helps us avoid switching testingType *then* finding out the spec doesn't exist
if (!this.ctx.fs.existsSync(absoluteSpecPath)) {
throw new RunSpecError('SPEC_NOT_FOUND', `No file exists at path ${absoluteSpecPath}`)
if (!this.ctx.fs.existsSync(specPath)) {
throw new RunSpecError('SPEC_NOT_FOUND', `No file exists at path ${specPath}`)
}

// We now know what testingType we need to be in - if we're already there, great
Expand Down Expand Up @@ -609,11 +610,11 @@ export class ProjectActions {
// a matching file exists above it may not end up loading as a valid spec so we validate that here
//
// Have to use toPosix here to align windows absolute paths with how the absolute path is storied in the data context
const spec = this.ctx.project.getCurrentSpecByAbsolute(toPosix(absoluteSpecPath))
const spec = this.ctx.project.getCurrentSpecByAbsolute(toPosix(specPath))

if (!spec) {
debug(`Spec not found with path: ${absoluteSpecPath}`)
throw new RunSpecError('SPEC_NOT_FOUND', `Unable to find matching spec with path ${absoluteSpecPath}`)
debug(`Spec not found with path: ${specPath}`)
throw new RunSpecError('SPEC_NOT_FOUND', `Unable to find matching spec with path ${specPath}`)
}

const browser = this.ctx.coreData.activeBrowser!
Expand Down
14 changes: 7 additions & 7 deletions packages/data-context/test/unit/actions/ProjectActions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('ProjectActions', () => {
describe('runSpec', () => {
context('no project', () => {
it('should fail with `NO_PROJECT`', async () => {
const result = await ctx.actions.project.runSpec({ specPath: 'e2e/abc.cy.ts' })
const result = await ctx.actions.project.runSpec({ specPath: '/Users/blah/Desktop/application/cypress/e2e/abc.cy.ts' })

sinon.assert.match(result, {
code: 'NO_PROJECT',
Expand Down Expand Up @@ -138,7 +138,7 @@ describe('ProjectActions', () => {
})

it('should fail with `NO_SPEC_PATTERN_MATCH`', async () => {
const result = await ctx.actions.project.runSpec({ specPath: 'e2e/abc.cy.ts' })
const result = await ctx.actions.project.runSpec({ specPath: '/Users/blah/Desktop/application/e2e/abc.cy.ts' })

sinon.assert.match(result, {
code: 'NO_SPEC_PATTERN_MATCH',
Expand All @@ -155,7 +155,7 @@ describe('ProjectActions', () => {
})

it('should fail with `SPEC_NOT_FOUND`', async () => {
const result = await ctx.actions.project.runSpec({ specPath: 'e2e/abc.cy.ts' })
const result = await ctx.actions.project.runSpec({ specPath: '/Users/blah/Desktop/application/e2e/abc.cy.ts' })

sinon.assert.match(result, {
code: 'SPEC_NOT_FOUND',
Expand All @@ -174,7 +174,7 @@ describe('ProjectActions', () => {
})

it('should fail with `TESTING_TYPE_NOT_CONFIGURED`', async () => {
const result = await ctx.actions.project.runSpec({ specPath: 'e2e/abc.cy.ts' })
const result = await ctx.actions.project.runSpec({ specPath: '/Users/blah/Desktop/application/e2e/abc.cy.ts' })

sinon.assert.match(result, {
code: 'TESTING_TYPE_NOT_CONFIGURED',
Expand Down Expand Up @@ -207,7 +207,7 @@ describe('ProjectActions', () => {
})

it('should succeed', async () => {
const result = await ctx.actions.project.runSpec({ specPath: 'e2e/abc.cy.ts' })
const result = await ctx.actions.project.runSpec({ specPath: '/Users/blah/Desktop/application/e2e/abc.cy.ts' })

sinon.assert.match(result, {
testingType: 'e2e',
Expand All @@ -228,7 +228,7 @@ describe('ProjectActions', () => {
})

it('should succeed', async () => {
const result = await ctx.actions.project.runSpec({ specPath: 'e2e/abc.cy.ts' })
const result = await ctx.actions.project.runSpec({ specPath: '/Users/blah/Desktop/application/e2e/abc.cy.ts' })

sinon.assert.match(result, {
testingType: 'e2e',
Expand All @@ -248,7 +248,7 @@ describe('ProjectActions', () => {
})

it('should succeed', async () => {
const result = await ctx.actions.project.runSpec({ specPath: 'e2e/abc.cy.ts' })
const result = await ctx.actions.project.runSpec({ specPath: '/Users/blah/Desktop/application/e2e/abc.cy.ts' })

sinon.assert.match(result, {
testingType: 'e2e',
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/schemas/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ type Mutation {
"""
runSpec(
"""
Relative path of spec to run from Cypress project root - must match e2e or component specPattern
Absolute path of the spec to run - must match e2e or component specPattern
"""
specPath: String!
): RunSpecResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ export const mutation = mutationType({
type: RunSpecResult,
args: {
specPath: nonNull(stringArg({
description: 'Relative path of spec to run from Cypress project root - must match e2e or component specPattern',
description: 'Absolute path of the spec to run - must match e2e or component specPattern',
})),
},
resolve: async (source, args, ctx) => {
Expand Down
Loading

5 comments on commit a5141a5

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a5141a5 Jun 13, 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.0.0/linux-x64/release/13.0.0-a5141a5ffa7ce604cd3944899bfc5a2891b2e057/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a5141a5 Jun 13, 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 arm64 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.0.0/linux-arm64/release/13.0.0-a5141a5ffa7ce604cd3944899bfc5a2891b2e057/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a5141a5 Jun 13, 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 arm64 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.0.0/darwin-arm64/release/13.0.0-a5141a5ffa7ce604cd3944899bfc5a2891b2e057/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a5141a5 Jun 13, 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.0.0/darwin-x64/release/13.0.0-a5141a5ffa7ce604cd3944899bfc5a2891b2e057/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on a5141a5 Jun 13, 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.0.0/win32-x64/release/13.0.0-a5141a5ffa7ce604cd3944899bfc5a2891b2e057/cypress.tgz

Please sign in to comment.