[Bug 22644] New: Some tests in Upload.t are not testing the right thing
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22644 Bug ID: 22644 Summary: Some tests in Upload.t are not testing the right thing 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: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Depends on: 17501 Target Milestone: --- Wondering if there is not something wrong or missing in t/db_dependent/Upload.t, the keep_file flag is not testing if the file is really kept. Also we are not testing if the files have been correctly created. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17501 [Bug 17501] Koha Objects for uploaded files -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22644 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 87429 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=87429&action=edit Bug 22644: Highlight the problem -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22644 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=22508 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22644 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |22508 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22508 [Bug 22508] Add the ability to prefill 856$u with the direct URL of the file -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22644 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- There is not a problem here, just a misunderstanding. As noted in the commment, the file does not exist here since a record is added via TestBuilder. In the preceding code you see a test for a warning about the missing file. Deleting a record twice while keeping the missing file is kind of exaggerated testing ;) So the patch here does not make sense. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22644 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- 162 my $delete = Koha::UploadedFiles->search({ id => $id })->delete; 163 isnt( $delete, "0E0", 'Delete successful' ); 164 isnt( -e $path, 1, 'File no longer found after delete' ); We are testing that the file has been deleted, but it never existed. Those tests do not test the whole purpose of the uploaded files. Moreover the new tests I have tried to write for bug 22508 are failing, because of this behavior. So, IMO, there is a real need here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22644 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Marcel, what do you think? How could I provide tests for bug 22508 without having this being fixed? Any ideas? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22644 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #4)
Marcel, what do you think? How could I provide tests for bug 22508 without having this being fixed? Any ideas?
Will have a look very soon. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22644 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- The test reflects the history of Upload to Uploader and UploadedFile(s) with Koha::Object(s). I think we should put the Uploader stuff into its own test Uploader.t. And put all Koha objects related tests to UploadedFile.t. What UploadedFile::delete may need, is a return code: deleting the record may have failed, but deleting the file as well. The test could be improved by adding some temporary files. And we need some decisions on 22508 as well. See my older comment there. Especially, do we copy the file or keep just one and allow direct access to selected subdirs of the clone upload folder? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org