From 892bfeb7f2e687b9a856e5e235561c9a8d05f46c Mon Sep 17 00:00:00 2001 From: Arne Johannessen Date: Fri, 6 Dec 2024 08:36:01 +0100 Subject: [PATCH] Skip test failing due to tx endpoint metadata bug REST::Neo4p 0.4003 can't parse the metadata for entities returned from Neo4j < 3.5 via the transaction endpoint (unless the Neo4j::Driver agent is used). This change prevents that bug from breaking the test suite. To reproduce the bug (will trigger a "Can't call method on unblessed reference" error): REST::Neo4p->begin_work; (my $q = REST::Neo4p::Query->new('MATCH (n) RETURN n LIMIT 1'))->execute; print $q->fetch->[0]->id; Issues with the tx response format aren't new. The changelog for version 0.2220 included a fix for it, but the response format was updated in later Neo4j versions, forcing further changes. I believe the current iteration of the bug may have been introduced in https://github.com/majensen/rest-neo4p/commit/2077e4bdbfc62f14482cc692172ec8539a1375b6. --- t/041_v2_txns.t | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/t/041_v2_txns.t b/t/041_v2_txns.t index 7fe2d06..824ccaa 100644 --- a/t/041_v2_txns.t +++ b/t/041_v2_txns.t @@ -31,6 +31,14 @@ diag "Test server unavailable (".$not_connected->message.") : tests skipped" if SKIP : { skip "Neo4j server version >= 2.0.0-M02 required, skipping...", $num_live_tests unless REST::Neo4p->_check_version(2,0,0,2); + skip 'Returning entities via tx endpoint needs either Driver agent or Neo4j 3.5+', $num_live_tests + unless REST::Neo4p->_check_version(3,5,0,0) + || REST::Neo4p->agent->isa('REST::Neo4p::Agent::Neo4j::Driver'); + # There is a known bug in _process_row/_response_entity in REST::Neo4p::Query + # that can prevent correct parsing of metadata for entities returned via the + # transaction endpoint. The metadata format varied between Neo4j versions. + # REST::Neo4p 0.3012-0.3030 worked correctly on some (not all) Neo4j versions. + my $neo4p = 'REST::Neo4p'; my ($n, $m); SKIP : {