Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: display an activity indicator in the CLI output when uploading artifacts to cypress cloud #28277

Merged
merged 22 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
62c9848
logic for activity indicator
cacieprins Nov 7, 2023
5e022b3
update snapshot & masking to handle upload duration, remove defunct m…
cacieprins Nov 7, 2023
99d7e42
Merge branch 'develop' into cacie/feat/upload-activity-indicator
cacieprins Nov 7, 2023
44b930d
update changelog
cacieprins Nov 7, 2023
8668d8b
check for existence of upload activity indicator before attempting to…
cacieprins Nov 7, 2023
753a7bb
Merge branch 'develop' into cacie/feat/upload-activity-indicator
cacieprins Nov 8, 2023
5357ecd
updates changelog
cacieprins Nov 8, 2023
e5b901d
Merge branch 'develop' into cacie/feat/upload-activity-indicator
cacieprins Nov 8, 2023
ec4f951
Update cli/CHANGELOG.md
cacieprins Nov 9, 2023
24b1381
Merge branch 'develop' into cacie/feat/upload-activity-indicator
cacieprins Nov 14, 2023
021f87f
upload activity display improvements; configurable intervals and delays
cacieprins Nov 14, 2023
88bb32c
system test snapshots for video compression
cacieprins Nov 14, 2023
2737c11
default delay and interval based on undefined rather than falsy
cacieprins Nov 14, 2023
2f06590
reduce interval so upload indicator is captured in certain system tests
cacieprins Nov 14, 2023
0be9ee0
Merge branch 'develop' into cacie/feat/upload-activity-indicator
cacieprins Nov 15, 2023
e73525f
Update CHANGELOG.md
cacieprins Nov 15, 2023
165645a
Update CHANGELOG.md
cacieprins Nov 15, 2023
7c8f7df
remove initial delay for upload activity
cacieprins Nov 15, 2023
3d35aa4
correctly evaluate if an upload activity interval env is set or not
cacieprins Nov 16, 2023
2690e76
re-inserts spacing before upload activity indicator
cacieprins Nov 20, 2023
02a0621
snapshots
cacieprins Nov 20, 2023
1edb778
Merge branch 'develop' into cacie/feat/upload-activity-indicator
jennifer-shehane Nov 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ _Released 11/21/2023 (PENDING)_

**Features:**

- When artifacts are uploaded to the Cypress Cloud, the duration of each upload will be displayed in the console. Addresses [#28237](/~https://github.com/cypress-io/cypress/issues/28237).
- Added an activity indicator to CLI output when artifacts (screenshots, videos, or Test Replay) are being uploaded to the cloud. Addresses [#28239](/~https://github.com/cypress-io/cypress/issues/28239). Addressed in [#28277](/~https://github.com/cypress-io/cypress/pull/28277).
- When artifacts are uploaded to the Cypress Cloud, the duration of each upload will be displayed in the terminal. Addresses [#28237](/~https://github.com/cypress-io/cypress/issues/28237).

**Bugfixes:**

Expand Down
14 changes: 12 additions & 2 deletions packages/server/lib/modes/record.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Config = require('../config')
const env = require('../util/env')
const terminal = require('../util/terminal')
const ciProvider = require('../util/ci_provider')
const { printPendingArtifactUpload, printCompletedArtifactUpload } = require('../util/print-run')
const { printPendingArtifactUpload, printCompletedArtifactUpload, beginUploadActivityOutput } = require('../util/print-run')
const testsUtils = require('../util/tests_utils')
const specWriter = require('../util/spec_writer')
const { fs } = require('../util/fs')
Expand Down Expand Up @@ -240,6 +240,12 @@ const uploadArtifactBatch = async (artifacts, protocolManager, quiet) => {
}
})

let stopUploadActivityOutput

if (!quiet && preparedArtifacts.filter(({ skip }) => !skip).length) {
stopUploadActivityOutput = beginUploadActivityOutput()
}

const uploadResults = await Promise.all(
preparedArtifacts.map(async (artifact) => {
if (artifact.skip) {
Expand Down Expand Up @@ -316,7 +322,11 @@ const uploadArtifactBatch = async (artifacts, protocolManager, quiet) => {
}
}
}),
)
).finally(() => {
if (stopUploadActivityOutput) {
stopUploadActivityOutput()
}
})

const attemptedUploadResults = uploadResults.filter(({ skipped }) => {
return !skipped
Expand Down
19 changes: 19 additions & 0 deletions packages/server/lib/util/print-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,3 +648,22 @@ export const printCompletedArtifactUpload = <T extends ArtifactUploadResultLike>

process.stdout.write('\n')
}

const UPLOAD_ACTIVITY_INTERVAL = typeof env.get('CYPRESS_UPLOAD_ACTIVITY_INTERVAL') === 'undefined' ? 15000 : env.get('CYPRESS_UPLOAD_ACTIVITY_INTERVAL')

export const beginUploadActivityOutput = () => {
console.log('')
process.stdout.write(chalk.bold.blue(' Uploading Cloud Artifacts: '))
process.stdout.write(chalk.bold.blue('. '))
const uploadActivityInterval = setInterval(() => {
process.stdout.write(chalk.bold.blue('. '))
}, UPLOAD_ACTIVITY_INTERVAL)

return () => {
if (uploadActivityInterval) {
console.log('')
}

clearInterval(uploadActivityInterval)
}
}
62 changes: 62 additions & 0 deletions system-tests/__snapshots__/record_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Fix the error in your code and re-run your tests.
- Screenshot - Nothing to upload
- 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)

- Video - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/1 /XXX/XXX/XXX/cypress/videos/record_error.cy.js.mp4
Expand Down Expand Up @@ -130,6 +132,8 @@ Because this error occurred during a \`before each\` hook we are skipping the re
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_fail.cy.js/record fails -- fails 1 -- before each hook (failed).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)

- Video - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/2 /XXX/XXX/XXX/cypress/videos/record_fail.cy.js.mp4
Expand Down Expand Up @@ -178,6 +182,8 @@ plugin stdout
- 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
Expand Down Expand Up @@ -244,6 +250,8 @@ We dynamically generated a new test to display this failure.
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_uncaught.cy.js/An uncaught error was detected outside of a test (failed).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)

- Video - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/2 /XXX/XXX/XXX/cypress/videos/record_uncaught.cy.js.mp4
Expand Down Expand Up @@ -1060,6 +1068,8 @@ plugin stdout
- 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
Expand Down Expand Up @@ -1576,6 +1586,8 @@ exports['e2e record api interaction errors update instance stdout warns but proc
- 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
Expand Down Expand Up @@ -1669,6 +1681,8 @@ exports['e2e record api interaction errors uploading assets warns but proceeds 1
- 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)

- Video - Failed Uploading after Xm, Ys ZZ.ZZms 1/2 /XXX/XXX/XXX/cypress/videos/record_pass.cy.js.mp4 - 500 - "Internal Server Error"
Expand Down Expand Up @@ -1775,6 +1789,8 @@ We will retry 3 more times in X second(s)...
- 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
Expand Down Expand Up @@ -2018,6 +2034,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing
- Video - Nothing to upload
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png

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
Expand Down Expand Up @@ -2103,6 +2121,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing
- Video - Nothing to upload
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png

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
Expand Down Expand Up @@ -2190,6 +2210,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing
- Video - Nothing to upload
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png

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
Expand Down Expand Up @@ -2275,6 +2297,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing
- Video - Nothing to upload
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png

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
Expand Down Expand Up @@ -2360,6 +2384,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing
- Video - Nothing to upload
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png

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
Expand Down Expand Up @@ -2445,6 +2471,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing
- Video - Nothing to upload
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png

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
Expand Down Expand Up @@ -2530,6 +2558,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing
- Video - Nothing to upload
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png

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
Expand Down Expand Up @@ -2615,6 +2645,8 @@ https://on.cypress.io/dashboard/organizations/org-id-1234/billing
- Video - Nothing to upload
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png

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
Expand Down Expand Up @@ -2706,6 +2738,8 @@ Details:
- 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
Expand Down Expand Up @@ -2787,6 +2821,8 @@ exports['e2e record capture-protocol disabled messaging displays disabled messag
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay - Nothing to upload - Test Replay is only supported in Chromium browsers

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
Expand Down Expand Up @@ -2868,6 +2904,8 @@ exports['e2e record capture-protocol enabled passing retrieves the capture proto
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay - 1 kB

Uploading Cloud Artifacts: . . . . .

(Uploaded Cloud Artifacts)

- Screenshot - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/2 /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
Expand Down Expand Up @@ -2954,6 +2992,8 @@ https://on.cypress.io/renderer-process-crashed
- Screenshot - Nothing to upload
- Test Replay - 1 kB

Uploading Cloud Artifacts: . . . . .

(Uploaded Cloud Artifacts)

- Test Replay - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/1
Expand Down Expand Up @@ -3000,6 +3040,8 @@ https://on.cypress.io/renderer-process-crashed
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay

Uploading Cloud Artifacts: . . . . .

(Uploaded Cloud Artifacts)

- Screenshot - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/2 /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
Expand Down Expand Up @@ -3080,6 +3122,8 @@ Error: Async error from plugins file
- Screenshot - Nothing to upload
- Test Replay - 1 kB

Uploading Cloud Artifacts: . . . . .

(Uploaded Cloud Artifacts)

- Test Replay - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/1
Expand Down Expand Up @@ -3161,6 +3205,8 @@ exports['e2e record capture-protocol enabled protocol runtime errors db size too
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay - 1 kB

Uploading Cloud Artifacts: . . . . .

(Uploaded Cloud Artifacts)

- Screenshot - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/2 /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
Expand Down Expand Up @@ -3243,6 +3289,8 @@ exports['e2e record capture-protocol enabled protocol runtime errors error initi
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay - Failed Capturing - Error instantiating Protocol Capture

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
Expand Down Expand Up @@ -3324,6 +3372,8 @@ exports['e2e record capture-protocol enabled protocol runtime errors error in pr
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay - Failed Capturing - Error in beforeSpec

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
Expand Down Expand Up @@ -3405,6 +3455,8 @@ exports['e2e record capture-protocol enabled protocol runtime errors error in pr
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay - Failed Capturing - error in beforeTest

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
Expand Down Expand Up @@ -3486,6 +3538,8 @@ exports['e2e record capture-protocol enabled protocol runtime errors non-fatal e
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay - 1 kB

Uploading Cloud Artifacts: . . . . .

(Uploaded Cloud Artifacts)

- Screenshot - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/2 /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
Expand Down Expand Up @@ -3568,6 +3622,8 @@ exports['capture-protocol api errors upload 500 - retries 8 times and fails cont
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay

Uploading Cloud Artifacts: . . . . .

(Uploaded Cloud Artifacts)

- Screenshot - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/2 /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
Expand Down Expand Up @@ -3650,6 +3706,8 @@ exports['capture-protocol api errors upload 500 - retries 7 times and succeeds o
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay - 1 kB

Uploading Cloud Artifacts: . . . . .

(Uploaded Cloud Artifacts)

- Screenshot - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/2 /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
Expand Down Expand Up @@ -3738,6 +3796,8 @@ We will retry 1 more time in X second(s)...
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay - Failed Capturing - Error downloading capture code: 500 - "500 - Internal Server Error"

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
Expand Down Expand Up @@ -3819,6 +3879,8 @@ exports['capture-protocol api errors error report 500 continues 1'] = `
- Screenshot - 1 kB /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
- Test Replay - 1 kB

Uploading Cloud Artifacts: . . . . .

(Uploaded Cloud Artifacts)

- Screenshot - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/2 /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png
Expand Down
2 changes: 2 additions & 0 deletions system-tests/__snapshots__/video_compression_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ exports['video compression true / coerces true to 32 CRF'] = `
- Screenshot - Nothing to upload
- 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)

- Video - Done Uploading 1 kB in Xm, Ys ZZ.ZZms 1/1 /XXX/XXX/XXX/cypress/videos/video_compression.cy.js.mp4
Expand Down
15 changes: 4 additions & 11 deletions system-tests/lib/normalizeStdout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,8 @@ const replaceTime = (str: string, p1: string) => {

const replaceScreenshotDims = (str: string, p1: string) => _.padStart('(YxX)', p1.length)

const replaceUploadingResults = function (orig: string, ...rest: string[]) {
const adjustedLength = Math.max(rest.length, 2)
const match = rest.slice(0, adjustedLength - 2)
const results = match[1].split('\n').map((res) => res.replace(/\(\d+\/(\d+)\)/g, '(*/$1)'))
.sort()
.join('\n')
const ret = match[0] + results + match[3]

return ret
const replaceUploadActivityIndicator = function (str: string, preamble: string, activity: string, ..._) {
return `${preamble}. . . . .`
}

// this captures an entire stack trace and replaces it with [stack trace lines]
Expand Down Expand Up @@ -156,8 +149,8 @@ export const normalizeStdout = function (str: string, options: any = {}) {
// 15 seconds -> XX seconds
.replace(/((\d+ minutes?,\s+)?\d+ seconds? *)/g, replaceTime)
.replace(/\r/g, '')
// replaces multiple lines of uploading screenshots & results (since order not guaranteed)
.replace(/(Uploading Screenshots & Videos.*?\n\n)((.*-.*[\s\S\r]){2,}?)(\n\n)/g, replaceUploadingResults)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mask was no longer in used, so replaced with the activity mask

// normalizes upload indicator to a consistent number of dots
.replace(/(Uploading Cloud Artifacts\: )([\. ]*)/g, replaceUploadActivityIndicator)
// fix "Require stacks" for CI
.replace(/^(\- )(\/.*\/packages\/server\/)(.*)$/gm, '$1$3')
// Different browsers have different cross-origin error messages
Expand Down
Loading
Loading