[Bug 24817] New: Add sleep calls to Koha::Cash::Register test
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 Bug ID: 24817 Summary: Add sleep calls to Koha::Cash::Register test Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: martin.renvoize@ptfs-europe.com Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org The tests can run at sub-second speeds, but add_cashup and outstanding_accountlines expect as this is a human interaction upon a cash register then we cannot end up with overlapping actions. We cannot use Time::Fake here as the timestamps are being added at the database trigger level. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 100215 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100215&action=edit Bug 24817: Add sleep between db create actions We need to allow some time to pass between calls that add cash register lines to accountlines or cash_register_actions. We use database level triggers to maintain the timestamp fields, so cannot use Time::Fake, and the methods we are testing assume that, as human interactions, there will be at least a second between the last 'sale' on a cash register and the 'cashup' of that same cash register. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24815 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24815 [Bug 24815] Koha::Cash::Register relations should return sets not undef -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Nope, using sleep in tests is wrong. Why do not you force the timestamp (NOW-1h for instance) for the account lines? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #2)
Nope, using sleep in tests is wrong. Why do not you force the timestamp (NOW-1h for instance) for the account lines?
Because I don't want to change add_cashup to accept a timestamp to be passed just to pass the test. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 100275 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100275&action=edit Bug 24817: Horrible cludge date setting to remove sleep -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- That second patch does the trick.. but in my opinion feels much worse than using a sleep. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |critical -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100215|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 100303 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100303&action=edit Bug 24817: Add sleep between db create actions We need to allow some time to pass between calls that add cash register lines to accountlines or cash_register_actions. We use database level triggers to maintain the timestamp fields, so cannot use Time::Fake, and the methods we are testing assume that, as human interactions, there will be at least a second between the last 'sale' on a cash register and the 'cashup' of that same cash register. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100275|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 100304 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100304&action=edit Bug 24817: Horrible cludge date setting to remove sleep Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add sleep calls to |Fix timing issues in |Koha::Cash::Register test |t/db_dependant/Koha/Cash/Re | |gister.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=24817 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100303|0 |1 is obsolete| | Attachment #100304|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 100326 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100326&action=edit Bug 24817: Add sleep between db create actions We need to allow some time to pass between calls that add cash register lines to accountlines or cash_register_actions. We use database level triggers to maintain the timestamp fields, so cannot use Time::Fake, and the methods we are testing assume that, as human interactions, there will be at least a second between the last 'sale' on a cash register and the 'cashup' of that same cash register. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 100327 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100327&action=edit Bug 24817: Horrible cludge date setting to remove sleep Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I do not think that's horrible. It's basically what we really want to test. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #10)
I do not think that's horrible. It's basically what we really want to test.
Thanks Jonathan.. think I'll reword the commit message on push.. I was in a down mood by the end of Friday.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100326|0 |1 is obsolete| | --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 100335 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100335&action=edit Bug 24817: Add sleep between db create actions We need to allow some time to pass between calls that add cash register lines to accountlines or cash_register_actions. We use database level triggers to maintain the timestamp fields, so cannot use Time::Fake, and the methods we are testing assume that, as human interactions, there will be at least a second between the last 'sale' on a cash register and the 'cashup' of that same cash register. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=24817 --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 100336 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100336&action=edit Bug 24817: Replace sleep calls with date setting in test data Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=24817 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100327|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24817 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com --- Comment #15 from Joy Nelson <joy@bywatersolutions.com> --- 'Does not apply' to 19.11.x branch. not backporting -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org