powerman / perl-JSON-RPC2

Perl module: JSON::RPC2 - Transport-independent implementation of JSON-RPC 2.0
https://metacpan.org/release/JSON-RPC2
Other
3 stars 2 forks source link

tests fail, "got: 'expect Object' expected: 'Parse error'" and similar #6

Closed akhuettel closed 3 months ago

akhuettel commented 3 months ago
huettel@kona ~/Gentoo/gentoo/dev-perl/JSON-RPC2 $ ebuild JSON-RPC2-2.1.2.ebuild clean test
Appending /home/huettel/Gentoo/gentoo to PORTDIR_OVERLAY...
Forcing test.
Fehler: Konnte Konfigurationsdatei '/etc/gitconfig' nicht sperren.: Keine Berechtigung
 * JSON-RPC2-v2.1.2.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                     [ ok ]
>>> Unpacking source...
>>> Unpacking JSON-RPC2-v2.1.2.tar.gz to /var/tmp/portage/dev-perl/JSON-RPC2-2.1.2/work
>>> Source unpacked in /var/tmp/portage/dev-perl/JSON-RPC2-2.1.2/work
>>> Preparing source in /var/tmp/portage/dev-perl/JSON-RPC2-2.1.2/work/JSON-RPC2-v2.1.2 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-perl/JSON-RPC2-2.1.2/work/JSON-RPC2-v2.1.2 ...
 * Using Module::Build::Tiny
 * perl Build.PL --installdirs=vendor --libdoc= --create_packlist=1 --config ar=x86_64-pc-linux-gnu-ar --config cc=x86_64-pc-linux-gnu-gcc --config cpp=x86_64-pc-linux-gnu-gcc -E --config ld=x86_64-pc-linux-gnu-gcc --config nm=x86_64-pc-linux-gnu-nm --config ranlib=x86_64-pc-linux-gnu-ranlib --config optimize=-O2 -pipe -march=native --config ldflags=-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs
Creating new 'Build' script for 'JSON-RPC2' version 'v2.1.2'
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-perl/JSON-RPC2-2.1.2/work/JSON-RPC2-v2.1.2 ...
Unknown option: libdoc
cp lib/JSON/RPC2/Client.pm blib/lib/JSON/RPC2/Client.pm
cp lib/JSON/RPC2.pm blib/lib/JSON/RPC2.pm
cp lib/JSON/RPC2/Server.pm blib/lib/JSON/RPC2/Server.pm
>>> Source compiled.
>>> Test phase: dev-perl/JSON-RPC2-2.1.2
 * Test::Harness Jobs=13
Unknown option: libdoc
t/author-perlcritic.t ...... skipped: these tests are for testing by the author
t/author-pod-syntax.t ...... skipped: these tests are for testing by the author
t/release-distribution.t ... skipped: these tests are for release candidate testing
t/01.export.t .............. skipped: This module doesn't export anything
===(       3;1  3/3  0/?  0/?  0/?  0/?  0/?  0/?  0/?  0/?  0/?... )===# Testing JSON::RPC2 v2.1.2
t/00.load.t ................ ok                                         
t/blocking.t ............... ok                                         
t/blocking_hashref.t ....... ok                                         
===(      46;1  4/?  3/?  1/?  1/?  0/?  0/?  0/?  0/?  0/?  0/?... )===# JSON::MaybeXS has loaded JSON::XS
t/client-batch.t ........... ok                                         
===(      59;1  7/?  4/?  5/?  0/?  0/?  0/?  0/?  0/?  0/?  0/? )======# JSON::MaybeXS has loaded JSON::XS
t/client-notify.t .......... ok                                         
===(     155;1  35/?  32/?  32/?  0/?  0/?  0/?  0/?  0/?  0/? )========# JSON::MaybeXS has loaded JSON::XS

#   Failed test 'not HASH'
#   at t/client-batch_response.t line 65.
#          got: 'expect Array or Object'
#     expected: 'Parse error'

#   Failed test at t/client-batch_response.t line 68.
#          got: 'expect Array or Object'
#     expected: 'Parse error'

#   Failed test at t/client-batch_response.t line 76.
#          got: 'expect Array or Object'
#     expected: 'Parse error'
# Looks like you failed 3 tests of 36.
t/client-batch_response.t .. Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/36 subtests 
===(     159;1  33/?  34/?  0/?  0/?  0/?  0/?  0/?  0/? )==============# JSON::MaybeXS has loaded JSON::XS
t/client-call.t ............ ok                                         
===(     162;1  36/?  0/?  0/?  0/?  0/?  0/?  0/? )====================# JSON::MaybeXS has loaded JSON::XS
t/client-call_named.t ...... ok                                         
===(     162;1  0/?  0/?  0/?  0/?  0/?  0/? )==========================# JSON::MaybeXS has loaded JSON::XS
===(     163;1  1/?  0/?  0/?  0/?  0/?  0/? )==========================# JSON::MaybeXS has loaded JSON::XS
t/client-notify_named.t .... ok                                         
t/client-pending.t ......... ok                                         
===(     183;1  0/?  0/?  0/?  0/? )====================================# JSON::MaybeXS has loaded JSON::XS
===(     184;1  1/?  0/?  0/?  0/? )====================================
#   Failed test 'not HASH'
#   at t/client-response.t line 60.
#          got: 'expect Object'
#     expected: 'Parse error'

#   Failed test at t/client-response.t line 63.
#          got: 'expect Object'
#     expected: 'Parse error'

#   Failed test at t/client-response.t line 71.
#          got: 'expect Object'
#     expected: 'Parse error'
# Looks like you failed 3 tests of 56.
t/client-response.t ........ Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/56 subtests 
===(     239;1  0/?  0/?  0/? )=========================================# JSON::MaybeXS has loaded JSON::XS
===(     240;1  1/?  0/?  0/? )=========================================# JSON::MaybeXS has loaded JSON::XS
===(     262;1  22/?  1/?  0/? )========================================
#   Failed test 'not Object'
#   at t/server-errors.t line 55.
#          got: '-32600'
#     expected: '-32700'

#   Failed test at t/server-errors.t line 57.
#          got: 'Invalid Request: expect Array or Object.'
#     expected: 'Parse error.'

#   Failed test at t/server-errors.t line 68.
#          got: '-32600'
#     expected: '-32700'
# JSON::MaybeXS has loaded JSON::XS
===(     285;1  22/?  23/?  1/? )=======================================
#   Failed test at t/server-errors.t line 69.
#          got: 'Invalid Request: expect Array or Object.'
#     expected: 'Parse error.'

#   Failed test at t/server-errors.t line 72.
#          got: '-32600'
#     expected: '-32700'

#   Failed test at t/server-errors.t line 73.
#          got: 'Invalid Request: expect Array or Object.'
#     expected: 'Parse error.'
# Looks like you failed 6 tests of 85.
t/server-errors.t .......... Dubious, test returned 6 (wstat 1536, 0x600)
Failed 6/85 subtests 
t/server-batch.t ........... ok                                         
t/server-execute.t ......... ok    

Test Summary Report
-------------------
t/client-batch_response.t (Wstat: 768 (exited 3) Tests: 36 Failed: 3)
  Failed tests:  11, 13, 21
  Non-zero exit status: 3
t/client-response.t      (Wstat: 768 (exited 3) Tests: 56 Failed: 3)
  Failed tests:  7-8, 12
  Non-zero exit status: 3
t/server-errors.t        (Wstat: 1536 (exited 6) Tests: 85 Failed: 6)
  Failed tests:  16-17, 22-25
  Non-zero exit status: 6
Files=18, Tests=390,  1 wallclock secs ( 0.04 usr  0.01 sys +  0.65 cusr  0.11 csys =  0.81 CPU)
Result: FAIL
 * ERROR: dev-perl/JSON-RPC2-2.1.2::gentoo failed (test phase):
 *   test failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_test
 *   environment, line 1848:  Called perl-module_src_test
 *   environment, line 1462:  Called die
 * The specific snippet of code:
 *           ./Build test verbose=${my_test_verbose} || die "test failed";
 * 
 * If you need support, post the output of `emerge --info '=dev-perl/JSON-RPC2-2.1.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-perl/JSON-RPC2-2.1.2::gentoo'`.
 * The complete build log is located at '/var/log/portage/dev-perl:JSON-RPC2-2.1.2:20240829-103842.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-perl/JSON-RPC2-2.1.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-perl/JSON-RPC2-2.1.2/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-perl/JSON-RPC2-2.1.2/work/JSON-RPC2-v2.1.2'
 * S: '/var/tmp/portage/dev-perl/JSON-RPC2-2.1.2/work/JSON-RPC2-v2.1.2'
powerman commented 3 months ago

Thanks for the report. I believe this is already fixed in current master branch, but I didn't released new version for some unknown (it was years ago, I just didn't remember) reason. I'll add latest perl versions to CI, check is everything works okay and release it today.

powerman commented 3 months ago

Okay, now I know why it wasn't released: it's about JSON::MaybeXS engines support. Fixing tests for JSON::XS and JSON::PP breaks them for Cpanel::JSON::XS and vice versa. :disappointed:

akhuettel commented 3 months ago

Okay, now I know why it wasn't released: it's about JSON::MaybeXS engines support. Fixing tests for JSON::XS and JSON::PP breaks them for Cpanel::JSON::XS and vice versa. :disappointed:

Do I understand this correctly, the breakage is mostly just that the error messages of the packages look different?

powerman commented 3 months ago

Error messages and in some cases also error codes (-32700 vs -32600 if it gets JSON null/number/string/etc - i.e. not an array or object). None of these is critical.

powerman commented 3 months ago

Fixed in v2.1.3.