Bug 38340 added a bunch of form includes that all live in the same dir, to the exclusion list. We should refactor those tests so one can set a directory for exclusion instead of listing each file.
Created attachment 181462 [details] [review] Bug 39741: Make valid-templates.t handle dirs This patch changes the regex so it doesn't expect the exclusion parameters to only be files but accept directories too. The risk of this is we might at some point catch more than we want. I don't think it is worth spending more time in it, though. To test: 1. Run: $ ktd --shell k$ prove xt/author/valid-templates.t => SUCCESS: Tests pass! 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! We don't need to list each individual file anymore and it will still work! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Another option could be to properly refactor the parameters so the exclusion lists are two: files and dirs. And each use a different regex. I leave my 2 cents here.
Created attachment 181559 [details] [review] Bug 39741: Make valid-templates.t handle dirs This patch changes the regex so it doesn't expect the exclusion parameters to only be files but accept directories too. The risk of this is we might at some point catch more than we want. I don't think it is worth spending more time in it, though. To test: 1. Run: $ ktd --shell k$ prove xt/author/valid-templates.t => SUCCESS: Tests pass! 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! We don't need to list each individual file anymore and it will still work! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD): 1. Tests pass before and after the patch. 2. Getting lots of output with these lines - not sure whether this is a good or bad thing: - Argument "" isn't numeric in numeric gt (>)... - # excluding template /kohadevbox/koha/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc because it cannot stand on its own