Bug 24494

Summary: 00-valid-xml.t shouldn't check node_modules
Product: Koha Reporter: Victor Grousset/tuxayo <victor>
Component: Test SuiteAssignee: Victor Grousset/tuxayo <victor>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, jonathan.druart, lucas, martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25928
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32352
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.04, 19.05.09
Attachments: Bug 24494: tests: 00-valid-xml.t shouldn't check node_modules
Bug 24494: tests: 00-valid-xml.t shouldn't check node_modules
Bug 24494: Make the regex more exact
Bug 24494: tests: 00-valid-xml.t shouldn't check node_modules
Bug 24494: Make the regex more exact

Description Victor Grousset/tuxayo 2020-01-23 14:52:48 UTC
node_modules exists when generating the CSS from the SCSS with yarn.

And it contains invalid XML file. Which shouldn't be validated by Koha's test suite.

./node_modules/json-schema/draft-zyp-json-schema-03.xml
./node_modules/json-schema/draft-zyp-json-schema-04.xml
Comment 1 Victor Grousset/tuxayo 2020-01-23 15:09:43 UTC
Created attachment 97825 [details] [review]
Bug 24494: tests: 00-valid-xml.t shouldn't check node_modules

== Test plan ==
- work with SCSS (just recompile it if you never did)
  - https://wiki.koha-community.org/wiki/Working_with_staff_client_SCSS
- now you have a node_modules directory
- prove -r t/00-valid-xml.t
- it should fail on files in node_modules
- apply this patch
- prove -r t/00-valid-xml.t
- it should work
- sabotage a legitimate XML file, like etc/SIPconfig.xml
- prove -r t/00-valid-xml.t
- it should fail, good the test is still useful
- undo the sabotage
Comment 2 Jonathan Druart 2020-02-13 16:01:53 UTC
Created attachment 98861 [details] [review]
Bug 24494: tests: 00-valid-xml.t shouldn't check node_modules

== Test plan ==
- work with SCSS (just recompile it if you never did)
  - https://wiki.koha-community.org/wiki/Working_with_staff_client_SCSS
- now you have a node_modules directory
- prove -r t/00-valid-xml.t
- it should fail on files in node_modules
- apply this patch
- prove -r t/00-valid-xml.t
- it should work
- sabotage a legitimate XML file, like etc/SIPconfig.xml
- prove -r t/00-valid-xml.t
- it should fail, good the test is still useful
- undo the sabotage

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Jonathan Druart 2020-02-13 16:01:56 UTC
Created attachment 98862 [details] [review]
Bug 24494: Make the regex more exact

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Martin Renvoize 2020-02-18 19:46:53 UTC
Created attachment 99221 [details] [review]
Bug 24494: tests: 00-valid-xml.t shouldn't check node_modules

== Test plan ==
- work with SCSS (just recompile it if you never did)
  - https://wiki.koha-community.org/wiki/Working_with_staff_client_SCSS
- now you have a node_modules directory
- prove -r t/00-valid-xml.t
- it should fail on files in node_modules
- apply this patch
- prove -r t/00-valid-xml.t
- it should work
- sabotage a legitimate XML file, like etc/SIPconfig.xml
- prove -r t/00-valid-xml.t
- it should fail, good the test is still useful
- undo the sabotage

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2020-02-18 19:46:56 UTC
Created attachment 99222 [details] [review]
Bug 24494: Make the regex more exact

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2020-02-18 19:47:29 UTC
Great work, been meaning to do this myself for ages..

Passed QA
Comment 7 Martin Renvoize 2020-02-19 11:34:49 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 8 Joy Nelson 2020-03-13 00:36:42 UTC
Pushed to 19.11.x branch for 19.11.04
Comment 9 Lucas Gass 2020-03-18 21:51:31 UTC
backported to 19.05.x for 19.05.09
Comment 10 Jonathan Druart 2022-11-25 11:12:39 UTC
*** Bug 22467 has been marked as a duplicate of this bug. ***