diff --git a/system-tests/__snapshots__/record_spec.js b/system-tests/__snapshots__/record_spec.js index 30e8f40fdc3c..3d2eaf9e4ab6 100644 --- a/system-tests/__snapshots__/record_spec.js +++ b/system-tests/__snapshots__/record_spec.js @@ -1124,6 +1124,8 @@ We encountered an unexpected error communicating with our servers. StatusCodeError: 500 - "Internal Server Error" +Because you passed the --record flag, this run cannot proceed because it requires a valid response from our servers. + ` exports['e2e record api interaction errors create run 500 when grouping without parallelization errors and exits 1'] = ` @@ -1131,6 +1133,8 @@ We encountered an unexpected error communicating with our servers. StatusCodeError: 500 - "Internal Server Error" +Because you passed the --record flag, this run cannot proceed because it requires a valid response from our servers. + The --group flag you passed was: foo The --ciBuildId flag you passed was: ciBuildId123 @@ -1193,6 +1197,8 @@ We encountered an unexpected error communicating with our servers. StatusCodeError: 500 - "Internal Server Error" +Because you passed the --record flag, this run cannot proceed because it requires a valid response from our servers. + ` exports['e2e record api interaction errors update instance 500 does not proceed and exits with error when parallelizing and updating instance 1'] = ` @@ -1409,6 +1415,8 @@ We encountered an unexpected error communicating with our servers. StatusCodeError: 500 - "Internal Server Error" +Because you passed the --record flag, this run cannot proceed because it requires a valid response from our servers. + ` exports['e2e record api interaction errors postInstanceTests without parallelization errors and exits 1'] = ` @@ -1435,6 +1443,8 @@ We encountered an unexpected error communicating with our servers. StatusCodeError: 500 - "Internal Server Error" +Because you passed the --record flag, this run cannot proceed because it requires a valid response from our servers. + The --group flag you passed was: foo The --ciBuildId flag you passed was: 1 @@ -1526,6 +1536,8 @@ We encountered an unexpected error communicating with our servers. StatusCodeError: 500 - "Internal Server Error" +Because you passed the --record flag, this run cannot proceed because it requires a valid response from our servers. + ` exports['e2e record api interaction errors update instance stdout warns but proceeds 1'] = ` @@ -1705,113 +1717,6 @@ exports['e2e record api interaction errors uploading assets warns but proceeds 1 Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 -` - -exports['e2e record api interaction errors api retries on error warns and does not create or update instances 1'] = ` -We encountered an unexpected error communicating with our servers. - -StatusCodeError: 500 - "Internal Server Error" - -We will retry 3 more times in X second(s)... - -We encountered an unexpected error communicating with our servers. - -StatusCodeError: 500 - "Internal Server Error" - -We will retry 2 more times in X second(s)... - -We encountered an unexpected error communicating with our servers. - -StatusCodeError: 500 - "Internal Server Error" - -We will retry 1 more time in X second(s)... - - -==================================================================================================== - - (Run Starting) - - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ Cypress: 1.2.3 │ - │ Browser: FooBrowser 88 │ - │ Specs: 1 found (record_pass.cy.js) │ - │ Searched: cypress/e2e/record_pass* │ - │ Params: Tag: nightly, Group: foo, Parallel: true │ - │ Run URL: https://dashboard.cypress.io/projects/cjvoj7/runs/12 │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - -We encountered an unexpected error communicating with our servers. - -StatusCodeError: 500 - "Internal Server Error" - -We will retry 3 more times in X second(s)... - - -──────────────────────────────────────────────────────────────────────────────────────────────────── - - Running: record_pass.cy.js (1 of 1) - Estimated: X second(s) - - - record pass - ✓ passes - - is pending - - - 1 passing - 1 pending - - - (Results) - - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ Tests: 2 │ - │ Passing: 1 │ - │ Failing: 0 │ - │ Pending: 1 │ - │ Skipped: 0 │ - │ Screenshots: 1 │ - │ Video: false │ - │ Duration: X seconds │ - │ Estimated: X second(s) │ - │ Spec Ran: record_pass.cy.js │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - - - (Screenshots) - - - /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png (400x1022) - - - (Uploading Cloud Artifacts) - - - Video - Nothing to upload - - Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png - - Test Replay - Nothing to upload - Test Replay is disabled for this project. Enable Test Replay in Cloud project settings - - Uploading Cloud Artifacts: . . . . . - - (Uploaded Cloud Artifacts) - - - Screenshot - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/1 /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png - -==================================================================================================== - - (Run Finished) - - - Spec Tests Passing Failing Pending Skipped - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ ✔ record_pass.cy.js XX:XX 2 1 - 1 - │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - ✔ All specs passed! XX:XX 2 1 - 1 - - - -─────────────────────────────────────────────────────────────────────────────────────────────────────── - - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 - - ` exports['e2e record api interaction errors sendPreflight [F1] socket errors fails after retrying 1'] = ` @@ -4479,3 +4384,88 @@ http://localhost:1234/capture-protocol/upload/?x-amz-credential=XXXXXXXX&x-amz-s ` + +exports['e2e record api interaction errors api retries on error errors and does not create or update instances when parallel 1'] = ` +We encountered an unexpected error communicating with our servers. + +StatusCodeError: 500 - "Internal Server Error" + +We will retry 3 more times in X second(s)... + +We encountered an unexpected error communicating with our servers. + +StatusCodeError: 500 - "Internal Server Error" + +We will retry 2 more times in X second(s)... + +We encountered an unexpected error communicating with our servers. + +StatusCodeError: 500 - "Internal Server Error" + +We will retry 1 more time in X second(s)... + + +==================================================================================================== + + (Run Starting) + + ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ Cypress: 1.2.3 │ + │ Browser: FooBrowser 88 │ + │ Specs: 1 found (record_pass.cy.js) │ + │ Searched: cypress/e2e/record_pass* │ + │ Params: Tag: nightly, Group: foo, Parallel: true │ + │ Run URL: https://dashboard.cypress.io/projects/cjvoj7/runs/12 │ + └────────────────────────────────────────────────────────────────────────────────────────────────┘ + +We encountered an unexpected error communicating with our servers. + +StatusCodeError: 500 - "Internal Server Error" + +Because you passed the --parallel flag, this run cannot proceed because it requires a valid response from our servers. + +The --group flag you passed was: foo +The --ciBuildId flag you passed was: ciBuildId123 + +` + +exports['e2e record api interaction errors api retries on error errors and does not create or update instances when recording and not parallel 1'] = ` +We encountered an unexpected error communicating with our servers. + +StatusCodeError: 500 - "Internal Server Error" + +We will retry 3 more times in X second(s)... + +We encountered an unexpected error communicating with our servers. + +StatusCodeError: 500 - "Internal Server Error" + +We will retry 2 more times in X second(s)... + +We encountered an unexpected error communicating with our servers. + +StatusCodeError: 500 - "Internal Server Error" + +We will retry 1 more time in X second(s)... + + +==================================================================================================== + + (Run Starting) + + ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ Cypress: 1.2.3 │ + │ Browser: FooBrowser 88 │ + │ Specs: 1 found (record_pass.cy.js) │ + │ Searched: cypress/e2e/record_pass* │ + │ Params: Tag: nightly, Group: false, Parallel: false │ + │ Run URL: https://dashboard.cypress.io/projects/cjvoj7/runs/12 │ + └────────────────────────────────────────────────────────────────────────────────────────────────┘ + +We encountered an unexpected error communicating with our servers. + +StatusCodeError: 500 - "Internal Server Error" + +Because you passed the --record flag, this run cannot proceed because it requires a valid response from our servers. + +` diff --git a/system-tests/test/record_spec.js b/system-tests/test/record_spec.js index 7192388b3bed..17f5c8db6091 100644 --- a/system-tests/test/record_spec.js +++ b/system-tests/test/record_spec.js @@ -1615,7 +1615,11 @@ describe('e2e record', () => { setupStubbedServer(routes) - it('warns and does not create or update instances', function () { + beforeEach(() => { + count = 0 + }) + + it('errors and does not create or update instances when parallel', function () { process.env.API_RETRY_INTERVALS = '1000,2000,3000' return systemTests.exec(this, { @@ -1628,6 +1632,7 @@ describe('e2e record', () => { parallel: true, snapshot: true, ciBuildId: 'ciBuildId123', + expectedExitCode: 1, }) .then(() => { const urls = getRequestUrls() @@ -1638,12 +1643,30 @@ describe('e2e record', () => { 'POST /runs', 'POST /runs', 'POST /runs/00748421-e035-4a3d-8604-8468cc48bdb5/instances', - 'POST /runs/00748421-e035-4a3d-8604-8468cc48bdb5/instances', - 'POST /instances/e9e81b5e-cc58-4026-b2ff-8ae3161435a6/tests', - 'POST /instances/e9e81b5e-cc58-4026-b2ff-8ae3161435a6/results', - 'PUT /screenshots/1.png', - 'PUT /instances/e9e81b5e-cc58-4026-b2ff-8ae3161435a6/artifacts', - 'PUT /instances/e9e81b5e-cc58-4026-b2ff-8ae3161435a6/stdout', + ]) + }) + }) + + it('errors and does not create or update instances when recording and not parallel', function () { + process.env.API_RETRY_INTERVALS = '1000,2000,3000' + + return systemTests.exec(this, { + key: 'f858a2bc-b469-4e48-be67-0876339ee7e1', + configFile: 'cypress-with-project-id.config.js', + spec: 'record_pass*', + tag: 'nightly', + record: true, + snapshot: true, + expectedExitCode: 1, + }) + .then(() => { + const urls = getRequestUrls() + + expect(urls).to.deep.eq([ + 'POST /runs', + 'POST /runs', + 'POST /runs', + 'POST /runs', 'POST /runs/00748421-e035-4a3d-8604-8468cc48bdb5/instances', ]) })