-
Notifications
You must be signed in to change notification settings - Fork 981
[QA] Fix Cypress 15 video artifact cleanup (handle compressed files) #7183
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances Cypress video cleanup logic to handle both regular and compressed test failure videos more effectively. The changes improve the after:spec and after:run hooks to delete videos from passing tests while preserving failure videos, and to clean up empty directories and those containing only compressed videos.
Changes:
- Modified failure detection in after:spec hook to use
results.stats.failuresinstead of checking individual test attempts - Added cleanup for both regular and compressed video files after successful test runs
- Enhanced after:run hook to also remove folders containing only compressed videos (in addition to empty folders)
savascountly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
This PR fixes the artifact cleanup behavior after upgrading to Cypress 15.
Cypress 15 introduced a new video pipeline where raw videos are post-processed and replaced with *-compressed.mp4 files. Because of this, passing specs were still leaving behind compressed videos and their folders, even though they should have been removed.
This change ensures that:
Videos are kept only for specs that fail.
Videos are removed for specs that pass (including retry-pass).
Both raw and *-compressed.mp4 files are properly cleaned up.
Empty and pass-only folders are removed.
Screenshot behavior remains unchanged.
What changed?
Updated after:spec hook to remove both raw and compressed videos for passing specs.
Improved after:run cleanup logic to remove folders that only contain compressed artifacts.
Kept existing PDF validation task and browser flags intact.
Why?
After upgrading to Cypress 15, compressed video artifacts were being generated even for passing specs. This caused:
Unnecessary video uploads
Cluttered artifact storage
Confusing CI outputs
This PR restores the expected behavior: only failed specs produce artifacts.