Bug 37493 - Cypress videos and screenshots should be .gitignored
Summary: Cypress videos and screenshots should be .gitignored
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Pedro Amorim
QA Contact: Katrin Fischer
URL:
Keywords: additional_work_needed
Depends on:
Blocks:
 
Reported: 2024-07-26 13:19 UTC by Pedro Amorim
Modified: 2024-09-03 04:21 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This updates .gitignore so that the directories for any screenshots and videos created by cypress tests are ignored by git. The directories created are: - t/cypress/screenshots/ - t/cypress/videos/
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 37493: [DONT PUSH] Test only (1.11 KB, patch)
2024-07-26 13:22 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 37493: Update .gitignore (654 bytes, patch)
2024-07-26 13:22 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 37493: [DONT PUSH] Test only - Force test fail (1.09 KB, patch)
2024-07-26 13:27 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 37493: Update .gitignore (654 bytes, patch)
2024-07-26 13:27 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 37493: [DONT PUSH] Test only - Force test fail (1.14 KB, patch)
2024-07-27 01:07 UTC, David Nind
Details | Diff | Splinter Review
Bug 37493: Update .gitignore (703 bytes, patch)
2024-07-27 01:07 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2024-07-26 13:19:20 UTC

    
Comment 1 Pedro Amorim 2024-07-26 13:22:49 UTC Comment hidden (obsolete)
Comment 2 Pedro Amorim 2024-07-26 13:22:52 UTC Comment hidden (obsolete)
Comment 3 Pedro Amorim 2024-07-26 13:27:05 UTC
Created attachment 169708 [details] [review]
Bug 37493: [DONT PUSH] Test only - Force test fail

Apply this patch only, run:
1) cypress run --spec "t/cypress/integration/flatpickr_spec.ts"
2) run `git status`.
  Notice t/cypress/screenshots/ and t/cypress/videos/ show
3) Apply 2nd patch. Repeat 2). Notice its empty
Comment 4 Pedro Amorim 2024-07-26 13:27:07 UTC
Created attachment 169709 [details] [review]
Bug 37493: Update .gitignore

Add t/cypress/screenshots/
Add t/cypress/videos/
Comment 5 David Nind 2024-07-27 01:07:48 UTC
Created attachment 169794 [details] [review]
Bug 37493: [DONT PUSH] Test only - Force test fail

Apply this patch only, run:
1) cypress run --spec "t/cypress/integration/flatpickr_spec.ts"
2) run `git status`.
  Notice t/cypress/screenshots/ and t/cypress/videos/ show
3) Apply 2nd patch. Repeat 2). Notice its empty

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2024-07-27 01:07:51 UTC
Created attachment 169795 [details] [review]
Bug 37493: Update .gitignore

Add t/cypress/screenshots/
Add t/cypress/videos/

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2024-07-27 01:18:10 UTC
If these files are ignored, won't the space the screenshots and videos take up git* a little large after a while. Or are these removed automatically at some stage when the tests are all successfully run?

* A bad pun! 8-)
Comment 8 Katrin Fischer 2024-09-02 08:46:44 UTC
QA'd by RM.
Comment 9 Katrin Fischer 2024-09-02 08:47:47 UTC
(In reply to David Nind from comment #7)
> If these files are ignored, won't the space the screenshots and videos take
> up git* a little large after a while. Or are these removed automatically at
> some stage when the tests are all successfully run?
> 
> * A bad pun! 8-)

Hm, good question. I guess you will no longer see this files in the git status, so they might be easy to miss. 

Pedro, can you please comment?
Comment 10 Katrin Fischer 2024-09-02 10:27:25 UTC
Forgot to remove from local branch - pushed to main for now. 
Waiting for the reply to decide if we want to keep or not.
Comment 11 Pedro Amorim 2024-09-02 15:09:50 UTC
(In reply to David Nind from comment #7)
> If these files are ignored, won't the space the screenshots and videos take
> up git* a little large after a while. Or are these removed automatically at
> some stage when the tests are all successfully run?
> 
> * A bad pun! 8-)

I don't believe these will be removed after a while.
This was only a tiny enhancement to prevent me from adding videos to commits as I've done in the past, but I'm happy to have this dropped and ignore this locally.

(In reply to Katrin Fischer from comment #10)
> Forgot to remove from local branch - pushed to main for now. 
> Waiting for the reply to decide if we want to keep or not.

Please note that you have pushed the [DONT PUSH] patch. That'll cause cypress tests to fail:
https://github.com/Koha-Community/Koha/commit/0d69fc60904ec6ad95863977d8cdec35e29047bf

Mentioning this to make sure both patches are dropped.
Comment 12 Katrin Fischer 2024-09-02 15:21:11 UTC
Guess... this was not my best day.
I'll revert the DONT PUSH at least right now.
Comment 13 Katrin Fischer 2024-09-02 15:22:15 UTC
(In reply to Katrin Fischer from comment #12)
> Guess... this was not my best day.
> I'll revert the DONT PUSH at least right now.

Done.
Comment 14 Martin Renvoize (ashimema) 2024-09-03 04:21:10 UTC
Perhaps we add a QA hook to check that files in that space are not included in any commits instead?