From c8a09e9cef349f04b4bbe3386a881936ca5ecc71 Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Mon, 12 Jun 2023 15:04:56 +1000 Subject: [PATCH 1/3] chore: fix flaky windows tests --- .../cypress/e2e/config-files-error-handling.cy.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/launchpad/cypress/e2e/config-files-error-handling.cy.ts b/packages/launchpad/cypress/e2e/config-files-error-handling.cy.ts index 9da9b85a1779..22822695675e 100644 --- a/packages/launchpad/cypress/e2e/config-files-error-handling.cy.ts +++ b/packages/launchpad/cypress/e2e/config-files-error-handling.cy.ts @@ -1,5 +1,6 @@ import defaultMessages from '@packages/frontend-shared/src/locales/en-US.json' import pkg from '../../../../package.json' +import { getPathForPlatform } from './support/getPathForPlatform' const expectStackToBe = (mode: 'open' | 'closed') => { cy.get(`[data-cy="stack-open-${mode === 'open' ? 'true' : 'false'}"]`) @@ -161,7 +162,7 @@ describe('Launchpad: Error System Tests', () => { cy.findAllByTestId('collapsible').should('be.visible') cy.contains('h3', 'TSError') cy.contains('p', 'Your configFile is invalid:') - cy.contains('p', 'cy-projects/config-with-ts-syntax-error/cypress.config.ts') + cy.contains('p', getPathForPlatform('cy-projects/config-with-ts-syntax-error/cypress.config.ts')) cy.contains('p', 'It threw an error when required, check the stack trace below:') cy.withCtx(async (ctx) => { @@ -207,7 +208,7 @@ describe('Launchpad: Error System Tests', () => { cy.findAllByTestId('collapsible').should('be.visible') cy.contains('h3', 'Error') cy.contains('p', 'Your configFile is invalid:') - cy.contains('p', 'cy-projects/config-with-import-error/cypress.config.js') + cy.contains('p', getPathForPlatform('cy-projects/config-with-import-error/cypress.config.js')) cy.contains('p', 'It threw an error when required, check the stack trace below:') cy.get('[data-testid="error-code-frame"]').should('contain', 'cypress.config.js:3:23') @@ -222,7 +223,7 @@ describe('Launchpad: Error System Tests', () => { cy.findAllByTestId('collapsible').should('be.visible') cy.contains('h3', 'TSError') cy.contains('p', 'Your configFile is invalid:') - cy.contains('p', 'cy-projects/config-with-ts-module-error/cypress.config.ts') + cy.contains('p', getPathForPlatform('cy-projects/config-with-ts-module-error/cypress.config.ts')) cy.contains('p', 'It threw an error when required, check the stack trace below:') cy.get('[data-testid="error-code-frame"]').should('contain', 'cypress.config.ts:6:10') }) From ae8201e93dd383781bf59bd14e4dffa29f727055 Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Wed, 14 Jun 2023 09:00:26 +1000 Subject: [PATCH 2/3] chore: fix windows CI --- packages/app/cypress/e2e/cypress-in-cypress.cy.ts | 4 +++- packages/graphql/schemas/schema.graphql | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/app/cypress/e2e/cypress-in-cypress.cy.ts b/packages/app/cypress/e2e/cypress-in-cypress.cy.ts index b03785765182..98e144bc5a0d 100644 --- a/packages/app/cypress/e2e/cypress-in-cypress.cy.ts +++ b/packages/app/cypress/e2e/cypress-in-cypress.cy.ts @@ -403,8 +403,10 @@ describe('Cypress in Cypress', { viewportWidth: 1500, defaultCommandTimeout: 100 cy.contains('E2E specs').should('be.visible') cy.withCtx(async (ctx) => { + const currentProject = ctx.currentProject?.replaceAll('\\', '/') + const specPath = `${currentProject}/cypress/e2e/dom-content.spec.js` const url = `http://127.0.0.1:${ctx.gqlServerPort}/__launchpad/graphql?` - 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}` + const payload = `{"query":"mutation{\\nrunSpec(specPath:\\"${specPath}\\"){\\n__typename\\n... on RunSpecResponse{\\ntestingType\\nbrowser{\\nid\\nname\\n}\\nspec{\\nid\\nname\\n}\\n}\\n}\\n}","variables":null}` ctx.coreData.app.browserStatus = 'open' diff --git a/packages/graphql/schemas/schema.graphql b/packages/graphql/schemas/schema.graphql index 5e2864e1ace2..b9562d0b0f0e 100644 --- a/packages/graphql/schemas/schema.graphql +++ b/packages/graphql/schemas/schema.graphql @@ -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 From 7e4b0d82f2fbf4df9a3e8aac1dd8a4d19477ff4a Mon Sep 17 00:00:00 2001 From: Lachlan Miller Date: Wed, 14 Jun 2023 10:03:22 +1000 Subject: [PATCH 3/3] ci file --- .circleci/workflows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 946af87a5cbc..e4856ddd9417 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -53,6 +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: [ 'lmiller/fix-windows-regressions', << pipeline.git.branch >> ] - equal: [ 'matth/feat/chrome-headless', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/