[Bug 7994] New: Syntax error in yaml (syspref) files
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 Priority: P5 - low Change sponsored?: --- Bug ID: 7994 Assignee: adrien.saurat@biblibre.com Summary: Syntax error in yaml (syspref) files QA Contact: koha.sekjal@gmail.com Severity: enhancement Classification: Unclassified OS: All Reporter: paul.poulain@biblibre.com Hardware: All Status: ASSIGNED Version: master Component: Test Suite Product: Koha There is a syntax error in YAML files used for sysprefs. When you try to run a translation, you get a nasty: Syck parser (line 53, column 0): syntax error at /usr/lib/perl5/YAML/Syck.pm line 76, <$fh> line 1. We should probably add a test for yaml validity using Test::YAML::Valid perl package (BibLibre mantis 8667) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 --- Comment #1 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Created attachment 9276 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=9276&action=edit Bug 7994: scripts to check yaml files $ prove yaml_valid.t checks a closed list of files $ perl yaml_valid.pl -f myfile.yaml try to load a yaml file with YAML::LoadFile and show errors (both files pertidied) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |claire.hernandez@biblibre.c | |om --- Comment #2 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- $ prove yaml_valid.t yaml_valid.t .. 1/1 # Failed test '../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref is YAML' # at yaml_valid.t line 48. # Failed test '../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref is YAML' # at yaml_valid.t line 48. # Failed test '../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref is YAML' # at yaml_valid.t line 48. yaml_valid.t .. 18/1 # Looks like you planned 1 test but ran 19. # Looks like you failed 3 tests of 19 run. yaml_valid.t .. Dubious, test returned 3 (wstat 768, 0x300) All 1 subtests passed Test Summary Report ------------------- yaml_valid.t (Wstat: 768 Tests: 19 Failed: 18) Failed tests: 2-19 Non-zero exit status: 3 Parse errors: Bad plan. You planned 1 tests but ran 19. Files=1, Tests=19, 1 wallclock secs ( 0.04 usr 0.00 sys + 0.53 cusr 0.02 csys = 0.59 CPU) Result: FAIL Should be fixed: 15:17 ~/dev/versions/community/xt (bug_7994 $)$ perl yaml_valid.pl -f ../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref Testing file: ../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref KO! YAML Error: Invalid element in map Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT Line: 4 Document: 1 at /usr/local/share/perl/5.10.1/YAML/Loader.pm line 352 15:17 ~/dev/versions/community/xt (bug_7994 $)$ perl yaml_valid.pl -f ../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref Testing file: ../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref KO! YAML Error: Expected separator '---' Code: YAML_PARSE_ERR_NO_SEPARATOR Line: 83 Document: 2 at /usr/local/share/perl/5.10.1/YAML/Loader.pm line 81 15:19 ~/dev/versions/community/xt (bug_7994 $)$ perl yaml_valid.pl -f ../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref Testing file: ../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref KO! YAML Error: Invalid element in map Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT Line: 10 Document: 1 at /usr/local/share/perl/5.10.1/YAML/Loader.pm line 352 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 --- Comment #3 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- I don't see syck parser error in community master today: I just have a: ./translate install fr-FR Can't use string ("b0VIM 7.3") as a HASH ref while "strict refs" in use at LangInstaller.pm line 194. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #9276|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 --- Comment #4 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Created attachment 9277 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=9277&action=edit Bug 7994: fix sysprefs syntax yaml files -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 --- Comment #5 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Created attachment 9278 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=9278&action=edit Bug 7994: scripts to check yaml files $ prove yaml_valid.t checks a closed list of files $ perl yaml_valid.pl -f myfile.yaml try to load a yaml file with YAML::LoadFile and show errors (both files pertidied) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 claire.hernandez@biblibre.com <claire.hernandez@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=7994 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|adrien.saurat@biblibre.com |claire.hernandez@biblibre.c | |om -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #6 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- I just tried applying these patches and all 19 tests fail, even after I install Test::YAML::Valid. I get the same error for every single one: # Failed test '../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref is YAML' # at xt/yaml_valid.t line 50. # Looks like you failed 19 tests of 19. Shouldn't the tests pass? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 --- Comment #7 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Created attachment 10041 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10041&action=edit Fix indenting mistakes Fix error parse yaml files with $ perl yaml_valid.pl -f <file> After fixing all these mini mistakes I got: $ prove yaml_valid.t yaml_valid.t .. ../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences at yaml_valid.t line 27. yaml_valid.t .. ok All tests successful. Files=1, Tests=16, 0 wallclock secs ( 0.04 usr 0.00 sys + 0.45 cusr 0.00 csys = 0.49 CPU) Result: PASS -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #9277|0 |1 is obsolete| | Attachment #9278|0 |1 is obsolete| | Attachment #10041|0 |1 is obsolete| | --- Comment #8 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Created attachment 10043 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10043&action=edit replace old patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10043|0 |1 is obsolete| | --- Comment #9 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Created attachment 10044 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10044&action=edit Bug-7994-scripts-to-check-yaml-files.patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 --- Comment #10 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Created attachment 10045 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10045&action=edit Bug-7994-Fix-indenting-mistakes.patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #11 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Should be better: $ git bz apply 7994 ... $ cd xt $ prove yaml_valid.t yaml_valid.t .. ../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences at yaml_valid.t line 27. yaml_valid.t .. ok All tests successful. Files=1, Tests=16, 1 wallclock secs ( 0.04 usr 0.01 sys + 0.46 cusr 0.01 csys = 0.52 CPU) Result: PASS -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |kyle.m.hall@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10044|0 |1 is obsolete| | --- Comment #12 from Kyle M Hall <kyle.m.hall@gmail.com> --- Created attachment 10205 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10205&action=edit [SIGNED-OFF] Bug 7994: scripts to check yaml files $ prove yaml_valid.t checks a closed list of files $ perl yaml_valid.pl -f myfile.yaml try to load a yaml file with YAML::LoadFile and show errors (both files pertidied) Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 --- Comment #13 from Kyle M Hall <kyle.m.hall@gmail.com> --- Yaml checker works. Second patch does not apply. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 --- Comment #14 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Created attachment 10207 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10207&action=edit Bug 7994: scripts to check yaml files $ prove yaml_valid.t checks a closed list of files $ perl yaml_valid.pl -f myfile.yaml try to load a yaml file with YAML::LoadFile and show errors (both files pertidied) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10045|0 |1 is obsolete| | --- Comment #15 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Created attachment 10208 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10208&action=edit Bug 7994: Fix pref yaml errors -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10207|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #16 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- rebased / fixed patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10208|0 |1 is obsolete| | --- Comment #17 from Kyle M Hall <kyle.m.hall@gmail.com> --- Created attachment 10229 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10229&action=edit [SIGNED-OFF] Bug 7994: Fix pref yaml errors Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 Kyle M Hall <kyle.m.hall@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=7994 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |jonathan.druart@biblibre.co | |m --- Comment #18 from Jonathan Druart <jonathan.druart@biblibre.com> --- QA Comments: 1/ Usage is not correct: +=head1 USAGE + +From Koha root directory: + +prove -v xt/tt_valid.t 2/ It not possible to launch the test file from the koha home directory (prove xt/yaml_valid.t) (see the FindBin module) 3/ Don't you think it would be more friendly to do a test file (thus using Test::More) for your pl file ? 4/ You add a new dependency Test::YAML::Valid. I dont know if we have to add this dependency to koha (given that it is used for unit tests). Marking as Failed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 --- Comment #19 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Created attachment 10301 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10301&action=edit Bug 7994: scripts to check yaml files $ prove yaml_valid.t checks a closed list of files $ perl yaml_valid.pl -f myfile.yaml try to load a yaml file with YAML::LoadFile and show errors (both files pertidied) Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10205|0 |1 is obsolete| | Attachment #10301|0 |1 is obsolete| | --- Comment #20 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Created attachment 10302 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10302&action=edit [SIGNED-OFF] Bug 7994: scripts to check yaml files -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10229|0 |1 is obsolete| | --- Comment #21 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- Created attachment 10303 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10303&action=edit [SIGNED-OFF] Bug 7994: Fix pref yaml errors -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 --- Comment #22 from claire.hernandez@biblibre.com <claire.hernandez@biblibre.com> --- (In reply to comment #18)
1/ Usage is not correct: +=head1 USAGE + +From Koha root directory: + +prove -v xt/tt_valid.t
Yep done.
2/ It not possible to launch the test file from the koha home directory (prove xt/yaml_valid.t) (see the FindBin module)
Done but too much code for me for adding this "feature" - nothing more sexy?
3/ Don't you think it would be more friendly to do a test file (thus using Test::More) for your pl file ?
I don't know how to give a parameter to a test file and I wanted to have a "-f" option to test whatever you want (sudoc yaml file for example).
4/ You add a new dependency Test::YAML::Valid. I dont know if we have to add this dependency to koha (given that it is used for unit tests).
I think we should be free to add new test libraies if we need it for testing. For discusion irl monday :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 --- Comment #23 from Paul Poulain <paul.poulain@biblibre.com> --- (In reply to comment #22)
4/ You add a new dependency Test::YAML::Valid. I dont know if we have to add this dependency to koha (given that it is used for unit tests).
I think we should be free to add new test libraies if we need it for testing. For discusion irl monday :)
I agree with claire = it's not a Koha dependency, it's a jenkins one, I think it's OK not to add it to Koha (claire = shouldn't you switch back to signed-off ?) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off CC| |chris@bigballofwax.co.nz --- Comment #24 from Chris Cormack <chris@bigballofwax.co.nz> --- I agree with Paul, this is a test patch ... someone wrote a test!! we should be giving them flowers not making it harder for it to get into Koha -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |m.de.rooy@rijksmuseum.nl QA Contact|koha.sekjal@gmail.com |m.de.rooy@rijksmuseum.nl --- Comment #25 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- QA Comment: Some points have received attention. The new dependency should be marked optional. Please add it in a followup. The suggested additional options could be handled similarly. Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master Version|master |rel_3_10 --- Comment #26 from Paul Poulain <paul.poulain@biblibre.com> --- Patch pushed, and I don't think a follow-up is needed to add the dependency, because it's unneeded for a standard production server, ppl installing will be wondering why and if they should install this package -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7994 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable Version|rel_3_10 |rel_3_8 Severity|enhancement |trivial --- Comment #27 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.8.x, virtual flowers to Claire for not only fixing the error but writing a test script so errors won't creep back in. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org