[Bug 37898] New: All db dependent tests should run within a transaction
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Bug ID: 37898 Summary: All db dependent tests should run within a transaction Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Some tests do not cleanup and leave new data that might interfere with other tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com, | |tomascohen@gmail.com Assignee|chris@bigballofwax.co.nz |tomascohen@gmail.com --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This is boring but I'll submit what I've done so far in case someone can continue before I can come back. I run this to detect candidate tests: ```shell git grep --files-without-match '\->txn_begin' | grep -e '\.t$' | grep -v -e selenium -e www ``` and this are the ones I haven't checked yet: ``` Record/Record.t RecordProcessor_EmbedSeeFromHeadings.t Reports.t SIP/SIPServer.t Search.t Service.t SuggestionEngine_ExplodedTerms.t Template/Plugin/KohaDates.t Templates.t api/v1/erm_counter_registries.t api/v1/erm_sushi_services.t check_kohastructure.t ``` -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 171346 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171346&action=edit Bug 37898: Wrap Indexer.t inside a transaction This tests leave new data on the DB. This patch fixes it. To test: 1. Run: $ ktd --shell k$ echo "SELECT COUNT(*) FROM biblio \G" | koha-mysql kohadev 2. Run: k$ prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t => SUCCESS: Tests pass 3. Repeat 1 => FAIL: Biblio count raised 4. Apply this patch 5. Repeat 2 and 3 => SUCCESS: Tests pass => SUCCESS: Biblio count remains 6. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 171347 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171347&action=edit Bug 37898: Wrap labels tests inside transactions This tests are written in a way that the cleanup is done explicitly. So I found no evidence of them leaving the database dirty. But it felt worth wrapping anyway, because any dev adding something could easily introduce new data inadvertedly. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 171348 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171348&action=edit Bug 37898: Wrap Relationships.t inside a transaction This tests leave data on the DB and need to be fixed. This patch does that. To test: 1. Run: $ ktd --shell k$ echo "SELECT COUNT(*) FROM borrowers \G" | koha-mysql kohadev k$ echo "SELECT COUNT(*) FROM borrower_relationships \G" | koha-mysql kohadev 2. Run: k$ prove t/db_dependent/Patron/Relationships.t => SUCCESS: Tests pass 3. Repeat 1 => FAIL: Numbers don't match the original ones! 4. Apply this patch 5. Repeat 2 and 3 => SUCCESS: Tests still pass! => SUCCESS: Numbers match! 6. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 171349 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171349&action=edit Bug 37898: Wrap Patroncards.t inside a transaction This tests leave data on the DB and need to be fixed. This patch does that. To test: 1. Run: $ ktd --shell k$ echo "SELECT COUNT(*) FROM creator_layouts \G" | koha-mysql kohadev 2. Run: k$ prove t/db_dependent/Patroncards.t => SUCCESS: Tests pass 3. Repeat 1 => FAIL: Numbers don't match the original ones! 4. Apply this patch 5. Repeat 2 and 3 => SUCCESS: Tests still pass! => SUCCESS: Numbers match! 6. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 171353 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171353&action=edit Bug 37898: Wrap some ERM api tests inside a transaction Trivial ones. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- The cases the `git grep` cover are all fixed by this patches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171346|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 171611 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171611&action=edit Bug 37898: Wrap Indexer.t inside a transaction This tests leave new data on the DB. This patch fixes it. To test: 1. Run: $ ktd --shell k$ echo "SELECT COUNT(*) FROM biblio \G" | koha-mysql kohadev 2. Run: k$ prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t => SUCCESS: Tests pass 3. Repeat 1 => FAIL: Biblio count raised 4. Apply this patch 5. Repeat 2 and 3 => SUCCESS: Tests pass => SUCCESS: Biblio count remains 6. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171347|0 |1 is obsolete| | --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 171612 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171612&action=edit Bug 37898: Wrap labels tests inside transactions This tests are written in a way that the cleanup is done explicitly. So I found no evidence of them leaving the database dirty. But it felt worth wrapping anyway, because any dev adding something could easily introduce new data inadvertedly. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171348|0 |1 is obsolete| | --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 171613 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171613&action=edit Bug 37898: Wrap Relationships.t inside a transaction This tests leave data on the DB and need to be fixed. This patch does that. To test: 1. Run: $ ktd --shell k$ echo "SELECT COUNT(*) FROM borrowers \G" | koha-mysql kohadev k$ echo "SELECT COUNT(*) FROM borrower_relationships \G" | koha-mysql kohadev 2. Run: k$ prove t/db_dependent/Patron/Relationships.t => SUCCESS: Tests pass 3. Repeat 1 => FAIL: Numbers don't match the original ones! 4. Apply this patch 5. Repeat 2 and 3 => SUCCESS: Tests still pass! => SUCCESS: Numbers match! 6. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171349|0 |1 is obsolete| | --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 171614 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171614&action=edit Bug 37898: Wrap Patroncards.t inside a transaction This tests leave data on the DB and need to be fixed. This patch does that. To test: 1. Run: $ ktd --shell k$ echo "SELECT COUNT(*) FROM creator_layouts \G" | koha-mysql kohadev 2. Run: k$ prove t/db_dependent/Patroncards.t => SUCCESS: Tests pass 3. Repeat 1 => FAIL: Numbers don't match the original ones! 4. Apply this patch 5. Repeat 2 and 3 => SUCCESS: Tests still pass! => SUCCESS: Numbers match! 6. Sign off :-D Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171353|0 |1 is obsolete| | --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 171615 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171615&action=edit Bug 37898: Wrap some ERM api tests inside a transaction Trivial ones. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Going straight for QA here, thanks for the housekeeping work Tomas. All tests passing for me and database looking cleaner. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for all the hard work! Pushed to main for the next 24.11.00 release as RM Assistant -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38744 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to main |Needs documenting --- Comment #16 from Fridolin Somers <fridolin.somers@biblibre.com> --- This is more like an enhancement, so I close -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37898 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED CC| |david@davidnind.com --- Comment #17 from David Nind <david@davidnind.com> --- Test suite related, no changes to the manual required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org