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

fix: Treat Video compression 0 as false. #26503

Merged
merged 18 commits into from
Apr 17, 2023

Conversation

mjhenkes
Copy link
Member

Additional details

This Pull request also disables video compression for our tests in CI

The following table is a comparison between a develop ci run and a ci run in this branch, since it is not averaged over time the number just represent a snapshot in time and the real performance difference is probably somewhere in the middle.

CI Job Before After Difference
driver-integration-tests-chrome 10:26 9:32 -0:54
driver-integration-tests-chrome-beta 10:25 9:10 -1:15
driver-integration-tests-electron 11:14 9:57 -1:17
driver-integration-tests-firefox 8:48 10 +1:12
driver-integration-tests-webkit 12:41 11:08 -1:33
run-app-component-tests-chrome 4:06 4:02 -0:04
run-app-integration-tests-chrome 9:22 9:22 +/-0
run-frontend-shared-component-tests-chrome 5:01 3:37 -1:24
run-launchpad-component-tests-chrome 2:20 2:34 -0:14
run-launchpad-integration-tests-chrome 8 7:41 -0:19
run-reporter-component-tests-chrome 1:55 2:07 +0:12
system-tests-chrome 15:25 13:37 -1:48
system-tests-electron 16:25 16:09 -0:14
system-tests-firefox 11:28 12:05 +0:37
system-tests-webkit 8:22 8: 09 -0:13

Honeycomb metrics:
Comparing average job duration between develop and this branch
Average time spent in the video:post:procoessing span

Steps to test

  • Set video compression to zero, watch the video.

How has the user experience changed?

PR Tasks

@mjhenkes
Copy link
Member Author

This still needs a Changlog entry, but i'll add that after the next release.

@mjhenkes mjhenkes marked this pull request as ready for review April 14, 2023 14:20
@@ -493,7 +493,7 @@ commands:
# internal PR
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
CYPRESS_INTERNAL_ENABLE_TELEMETRY="true" \
OTEL_RESOURCE_ATTRIBUTES="ci.branch=$CIRCLE_BRANCH,ci.job=$CIRCLE_JOB,ci.node-index=$CIRCLE_NODE_INDEX,ci.circle=$CIRCLECI,ci.build-url=$CIRCLE_BUILD_URL,ci.build-number=$CIRCLE_BUILD_NUM" \
OTEL_RESOURCE_ATTRIBUTES="ci.branch=$CIRCLE_BRANCH,ci.job=$CIRCLE_JOB,ci.node-index=$CIRCLE_NODE_INDEX,ci.circle=$CIRCLECI,ci.build-url=$CIRCLE_BUILD_URL,ci.build-number=$CIRCLE_BUILD_NUM,SHA1=$CIRCLE_SHA1,PR_NUMBER=$CIRCLE_PR_NUMBER" \
Copy link
Member Author

Choose a reason for hiding this comment

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

adding to telemetry, i want to turn this into a custom detector, but thats for another pr

telemetry.getSpan('cypress')?.end()
const span = telemetry.getSpan('cypress')

span?.setAttribute('exitCode', code)
Copy link
Member Author

Choose a reason for hiding this comment

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

lets log out the exit code to know if jobs failed or not.

// or we've been told not to upload the video
if (options.videoCompression === false || options.shouldUploadVideo === false) {
if (options.videoCompression === false || options.videoCompression === 0 || options.shouldUploadVideo === false) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the bug fix.

Copy link
Member

Choose a reason for hiding this comment

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

if (!options.videoCompress || !options.shouldUploadVideo) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

i'd rather be explicit

@@ -676,7 +676,7 @@ async function waitForTestsToFinishRunning (options: { project: Project, screens

span?.setAttributes({
videoName,
videoCompression,
videoCompressionString: videoCompression.toString(),
Copy link
Member Author

Choose a reason for hiding this comment

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

honeycomb decided this value was an int, so false === 0... i changed it to a string to get the real value.

@@ -342,7 +342,7 @@ const isVideoSnapshotError = (err: Error) => {
_.pull(added, sometimesAddedVideoSnapshotLine, sometimesAddedSpacingLine)
_.pull(deleted, sometimesDeletedVideoSnapshotLine, sometimesAddedSpacingLine)

return _.isEqual(added, expectedAddedVideoSnapshotLines) && _.isEqual(deleted, expectedDeletedVideoSnapshotLines)
return _.isEqual(added, expectedAddedVideoSnapshotLines) && (deleted.length === 0 || _.isEqual(deleted, expectedDeletedVideoSnapshotLines))
Copy link
Member Author

Choose a reason for hiding this comment

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

This is modifying an existing workaround for the firefox video error... previously when video was being compressed there were lines that were missing from the saved snapshot... since with compression off, the video name isn't logged, now there are not deleted lines.

@@ -101,3 +102,15 @@ describe('e2e video compression', () => {
})
})
})

describe('video compression 0', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

a new test for video compression 0

@mjhenkes
Copy link
Member Author

I was honestly hoping to see better performance returns from system tests.

@@ -11,8 +11,8 @@ export default defineConfig({
reporter: '../../node_modules/cypress-multi-reporters/index.js',
reporterOptions: {
configFile: '../../mocha-reporter-config.json',
videoCompression: false, // turn off video compression for CI
Copy link
Contributor

Choose a reason for hiding this comment

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

Surprised this wasn't a typescript error.

Copy link
Member Author

Choose a reason for hiding this comment

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

same

@cypress
Copy link

cypress bot commented Apr 14, 2023

3 flaky tests on run #45607 ↗︎

0 5193 77 0 Flakiness 3

Details:

Merge branch 'develop' into matth/chore/disable-compression
Project: cypress Commit: 144df27edd
Status: Passed Duration: 13:17 💡
Started: Apr 17, 2023 9:22 PM Ended: Apr 17, 2023 9:36 PM
Flakiness  cypress/e2e/cypress/cypress.cy.js • 3 flaky tests • 5x-driver-electron

View Output Video

Test Artifacts
... > correctly returns currentRetry Output Video
... > correctly returns currentRetry Output Video
... > correctly returns currentRetry Output Video

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@mjhenkes mjhenkes merged commit 3d0a2b4 into develop Apr 17, 2023
@mjhenkes mjhenkes deleted the matth/chore/disable-compression branch April 17, 2023 21:33
astone123 pushed a commit to kgroat/cypress that referenced this pull request Apr 19, 2023
* chore: disable video compression

* system test updates

* moar system test fixes

* a couple of telemetry tweaks

* more intelligent defaults, don't touch firefox.

* trying this

* probably finally fix firefox system tests

* unformat plz

* ugh, also add a test

* plz stop formatting that file

* re-enable firefox tests

* Change log

* don't save videos to artifacts

* this will be fixed in another pr

* quoth the raven, quotes matter don't mess them up
ryanthemanuel added a commit that referenced this pull request May 1, 2023
Co-authored-by: Matt Henkes <mjhenkes@gmail.com>
Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com>
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
Co-authored-by: astone123 <adams@cypress.io>
Co-authored-by: Mark Noonan <mark@cypress.io>
Co-authored-by: Mike Plummer <mike-plummer@users.noreply.github.com>
Co-authored-by: Mike Plummer <mikep@cypress.io>
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
Co-authored-by: Stokes Player <stokes.player@gmail.com>
Co-authored-by: Stokes Player <stokes@cypress.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Adam Stone-Lord <adams@cypress.io>
Co-authored-by: Ben M <benm@cypress.io>
Co-authored-by: Jordan <jordan@jpdesigning.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Barthélémy Ledoux <bart@cypress.io>
fix: Treat Video compression 0 as false.  (#26503)
fix: don't display run passing status if Cloud org is over run limit (#26533)
fix: unify cdp approach to fix devtools in electron (#26573)
tgriesser added a commit that referenced this pull request May 3, 2023
* feat/protocol:
  refactor: migrate from windi to tailwind (#26516)
  chore: update v8 generation vars so that from scratch depends implies updating the metafile (#26472)
  chore: Update Vite to 4.3.0 (#26553)
  fix: unify cdp approach to fix devtools in electron (#26573)
  dependency(deps): update dependency deps-ok to v1.4.1 🌟 (#26612)
  chore: update 12.11.0 release date (#26587)
  chore: 12.11.0 release (#26582)
  chore: implement experimental ESM stub/spy for Vite (#26536)
  chore: try triggering mouseleave on buttons to ensure that tooltips aren't showing (#26524)
  chore: add support for Angular 16 (#26052)
  chore: upgrade Vue to 3.2.47 (#26555)
  chore: Update v8 snapshot cache (#26537)
  chore: add missing utm parameters for cloud links to Debug page (#26556)
  chore: update stalebot to respect new labels and up process rate (#26552)
  fix: don't display run passing status if Cloud org is over run limit (#26533)
  chore: update vm2 to 3.9.17 (#26534)
  feat: display a limit warning on the run navigation component when there are 100 total runs (#26523)
  chore: Update v8 snapshot cache (#26476)
  chore: upgrade vm2 (#26495)
  fix: Treat Video compression 0 as false.  (#26503)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants