Skip to content

Conversation

@can-angun
Copy link
Contributor

@can-angun can-angun commented Jan 20, 2026

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.

@can-angun can-angun self-assigned this Jan 20, 2026
@can-angun can-angun changed the title [QA] Test Update ratingsValue from '0' to '1' in widget [QA] Test PR for checking uploaded failure videos Jan 20, 2026
@can-angun can-angun changed the title [QA] Test PR for checking uploaded failure videos [QA] Fix Cypress 15 video artifact cleanup (handle compressed files) Jan 22, 2026
Copy link
Contributor

Copilot AI left a 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.failures instead 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)

Copy link
Contributor

@savascountly savascountly left a comment

Choose a reason for hiding this comment

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

Good job!

@can-angun can-angun merged commit b4c7ed7 into master Jan 22, 2026
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants