-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix: prevent overwriting of video files #30673
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
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. |
Hey I'm facing some issues while syncing my branch with develop. There were some conflicts because develop has changed the |
@YJDoc2 We haven't forgotten about this PR! We're working hard on getting Cypress 14 out first because we don't want to add any more scope to that release, so this will go in a release after that if approved. We can take a look at the conflicts - indeed a lot changed. |
I didn't know that, makes sense to wait for release before adding this then.
Yep, I'm still interested in following this PR, so when the release is done and you all have bandwidth for this, ping me and we can figure out the problem together. I'll pause any update on this in the meantime, as because the pre-commit hook itself is failing, I cannot push any updates at all. Thanks for your response and follow-up! |
Co-authored-by: Mike McCready <[email protected]>
I have the conflicts fixed in my branch, but I need to get these eslint fixes in first because the repo is in a weird place without that. d9550ad |
K, I've got a cleaner merge on this PR now |
Signed-off-by: Yashodhan Joshi <[email protected]>
Hey @jennifer-shehane I have updated the call of Another thing to mention, the e2e tests I had added were passing when I added them, however now they are failing with ts related errors in the auth module. Do you know anything about it? The exact error is -
Thanks :) |
@YJDoc2 We won't have time to dedicate to updating this PR at the moment as we're focused on other things. We'll likely need to close it if the issues can't be resolved. |
Ok, I needed some help with the auth error in test ; but if you don't have available time to look at this, give me maybe till this weekend, I'll try to see if I can do something. Apart from that, there is nothing blocking for this, right? |
Hey, is there any issue with snapshot builing on develop branch? I tried to clean the workspace and re-install everything, but the snapshot generation is failing . There is no specific error but the last step in log is metadata generation. Because snapshot generation is failing, I cannot run the tests to fix them. Please let me know if there is any know issue with snapshot generation . |
@YJDoc2 going to make a note to take a look at this tomorrow |
Hi @YJDoc2. Looks like mksnapshot wasn't happy with trying to due type imports in the same place as actual imports (I had to turn the error debug logs on to see it) I broke this out into a separate line, updated the branch with |
@AtofStryker , thanks a lot of the fixes, they worked like a charm! Snapshot generation and my tests are both working now. Thanks a lot :) @jennifer-shehane , so as of the latest commit,
Apart from that, anything else I need to do? let me know. Thanks :) |
Signed-off-by: Yashodhan Joshi <[email protected]>
packages/server/lib/modes/run.ts
Outdated
if (!options.videosFolder) throw new Error('Missing videoFolder for recording') | ||
|
||
function videoPath (suffix: string) { | ||
return path.join(options.videosFolder, options.spec.relativeToCommonRoot + suffix) | ||
async function videoPath (suffix: string, ext: string) { |
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.
this might read a bit easier when invoked if the suffix was an optional argument and the last argument of the function.
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.
I have changed it, so that the suffix is second arg, with a default value, so if nothing is passed it takes ''
as default value. That said I'm not sure if this is better or not from before, so can you check once? I have added it as a separate commit, so can be directly reverted if not useful - 07577ed
system-tests/projects/issue-8280-retain-video/cypress/e2e/spec2.cy.js
Outdated
Show resolved
Hide resolved
system-tests/projects/issue-8280-retain-video/cypress/e2e/spec1.cy.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Yashodhan Joshi <[email protected]>
Signed-off-by: Yashodhan Joshi <[email protected]>
Signed-off-by: Yashodhan Joshi <[email protected]>
Signed-off-by: Yashodhan Joshi <[email protected]>
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.
Great work on this @YJDoc2 !
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
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.