[Bug 14195] New: TestBuilder does not generate the good length for text fields
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 Bug ID: 14195 Summary: TestBuilder does not generate the good length for text fields Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Test Suite Assignee: jonathan.druart@biblibre.com Reporter: jonathan.druart@biblibre.com QA Contact: gmcharlt@gmail.com Depends on: 12603 t::lib::TestBuilder::_gen_text does not use correctly the regex and the max parameter to generate the random string (String::Random). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39138 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39138&action=edit Bug 14105: TestBuilder - A random string should not be longer than the DB field t::lib::TestBuilder::_gen_text does not use correctly the regex and the max parameter to generate the random string (String::Random). This can cause future tests to fail. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39139 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39139&action=edit To reproduce the issue Launch this script several times, without applying the patch. If the generated string for categorycode has a length > 10, you will see a difference. After applying the patch, the difference should never occur. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 Indranil Das Gupta <indradg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |indradg@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14045 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39138|0 |1 is obsolete| | --- Comment #3 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 39200 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39200&action=edit [SIGNED-OFF] Bug 14195: TestBuilder - A random string should not be longer than the DB field t::lib::TestBuilder::_gen_text does not use correctly the regex and the max parameter to generate the random string (String::Random). This can cause future tests to fail. http://bugs.koha-community.org/show_bug.cgi?id=14195 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Script tested, problem occurs, patch fixes it. Bad number on commit subject No errors -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 --- Comment #4 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 39201 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39201&action=edit Bug 14195: (followup) increment number of tests Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Patch complexity|--- |Small patch QA Contact|gmcharlt@gmail.com |m.de.rooy@rijksmuseum.nl --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Small question before passing QA: why do you decrement $size here: + if ( defined $size and $size > 1 ) { + $size--; -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Marcel de Rooy from comment #5)
Small question before passing QA: why do you decrement $size here:
+ if ( defined $size and $size > 1 ) { + $size--;
Because the regex, in this case, is [A-Za-z][A-Za-z0-9_]* And the max size passed to String::Random is related to the wild card, not the the size of the complete string. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39200|0 |1 is obsolete| | Attachment #39201|0 |1 is obsolete| | --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 39340 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39340&action=edit Bug 14195: TestBuilder - A random string should not be longer than the DB field t::lib::TestBuilder::_gen_text does not use correctly the regex and the max parameter to generate the random string (String::Random). This can cause future tests to fail. http://bugs.koha-community.org/show_bug.cgi?id=14195 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Script tested, problem occurs, patch fixes it. Bad number on commit subject No errors Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 39341 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39341&action=edit Bug 14195: (followup) increment number of tests Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #6)
Because the regex, in this case, is [A-Za-z][A-Za-z0-9_]* And the max size passed to String::Random is related to the wild card, not the the size of the complete string.
Fine. Could have read this in your comment :) Just not very intuitive Random parameter.. Thanks. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Passed QA |Pushed to Master --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14195 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14256 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org