Skip to content

Commit

Permalink
Skip test failing due to tx endpoint metadata bug
Browse files Browse the repository at this point in the history
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 2077e4b.
  • Loading branch information
johannessen committed Dec 11, 2024
1 parent 47ac2af commit 892bfeb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions t/041_v2_txns.t
Original file line number Diff line number Diff line change
Expand Up @@ -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 : {
Expand Down

0 comments on commit 892bfeb

Please sign in to comment.