-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: prevent overwriting of video files #30673
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: Yashodhan Joshi <[email protected]>
|
Not sure why semantic CI is failing, I have added changelog entry. I don't think this will make to the next release so might have to update it later. btw, this PR is ready for review. |
The previous PR introduced an unwanted blank line 2 which is causing your failure. Lines 1 to 3 in 12df40e
The blank line should be removed.
|
Signed-off-by: Yashodhan Joshi <[email protected]>
Hey @MikeMcC399 , thanks for the help! I have fixed the changelog and pushed. |
@YJDoc2 Thanks for the contribution. Can you write a test that verifies the change in behavior? |
Signed-off-by: Yashodhan Joshi <[email protected]>
Signed-off-by: Yashodhan Joshi <[email protected]>
Hey @jennifer-shehane , I have added a system test for this change. Also I synced the branch using develop-merge, if you want me to rebase instead, I'll do it and push. Thanks :) |
@YJDoc2 Thanks! We'll give it a look over as soon as we can. |
@@ -6,6 +6,7 @@ _Released 12/17/2024 (PENDING)_ | |||
**Bugfixes:** | |||
|
|||
- Fixed an issue where targets may hang if `Network.enable` is not implemented for the target. Addresses [#29876](https://github.com/cypress-io/cypress/issues/29876). | |||
- Prevent overwriting of video files across multiple runs. Addresses [#8280](https://github.com/cypress-io/cypress/issues/8280). Addressed in [#30673](https://github.com/cypress-io/cypress/pull/30673). |
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.
- Prevent overwriting of video files across multiple runs. Addresses [#8280](https://github.com/cypress-io/cypress/issues/8280). Addressed in [#30673](https://github.com/cypress-io/cypress/pull/30673). | |
- Fixed an issue where the configuration setting `trashAssetsBeforeRuns=false` was ignored for assets in the `videosfolder` and these assets were incorrectly deleted before running tests with `cypress run`. Addresses [#8280](https://github.com/cypress-io/cypress/issues/8280). |
- Orient the Changelog text towards the configuration description in https://docs.cypress.io/app/references/configuration#Screenshots and use a similar style for the description as used in other Changelog entries
- Only list the issue ID, not the PR ID as well (see https://github.com/cypress-io/cypress/blob/develop/guides/writing-the-cypress-changelog.md#writing-guidelines).
Additional details
Why was this change necessary?
Currently multiple runs of cypress in same dir (with trashAssetsBeforeRuns=false) will keep the screenshots files across runs, but will overwrite the video file. For more details, please check the issue discussion.
What is affected by this change?
The videos dir will now retain existing video files if trashAssetsBeforeRuns=false is set
Any implementation details to explain?
Nothing much, I have moved the getPath function used for generating screenshot paths into
fs.ts
fromscreenshot.js
and did some minor modifications to accommodate both screenshots and videos. There is one "hack" which I'm not sure how to fix, help appreciated :-compressed
suffix even if video compression is off.Steps to test
For current
develop
branch,spec1 -- testCase1 (failed).png
and other with namespec1 -- testCase1 (failed) (1).png
spec1.cy.js.mp4
For this branch,
spec1 -- testCase1 (failed).png
and other with namespec1 -- testCase1 (failed) (1).png
spec1.cy.js.mp4
andspec1.cy.js (1).mp4
How has the user experience changed?
They will keep the videos from previous runs if any.
PR Tasks
cypress-documentation
: This is a bug fix, I don't think this is applicable,type definitions
: I don't think this is applicable.