From 39f3bc8f67c6260fdf9470d71def6dd25e7e0e5b Mon Sep 17 00:00:00 2001 From: Florent Biville Date: Wed, 25 Aug 2021 09:44:24 +0200 Subject: [PATCH 1/2] Remove outdated comment --- testkit/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/testkit/Dockerfile b/testkit/Dockerfile index f728857f..507b1f20 100644 --- a/testkit/Dockerfile +++ b/testkit/Dockerfile @@ -3,7 +3,6 @@ FROM ubuntu:20.04 ARG go_version=1.16.7 # Install all needed to build and run tests -# This will install the default distribution Go version, for 18.04 this means 1.10 # Install tzdata to make sure Go timezone info works correctly (need noninteractive to avoid # timezone prompt when installing) ARG DEBIAN_FRONTEND=noninteractive From 1c567418faf8eb2e0423b5d84e0737c3bccc6a77 Mon Sep 17 00:00:00 2001 From: Florent Biville Date: Wed, 25 Aug 2021 11:20:12 +0200 Subject: [PATCH 2/2] Support testkit serialization of relationships and paths --- testkit-backend/2cypher.go | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/testkit-backend/2cypher.go b/testkit-backend/2cypher.go index cefe10b7..b8e147c3 100644 --- a/testkit-backend/2cypher.go +++ b/testkit-backend/2cypher.go @@ -59,11 +59,38 @@ func nativeToCypher(v interface{}) map[string]interface{} { return valueResponse("CypherMap", values) case neo4j.Node: return map[string]interface{}{ - "name": "Node", "data": map[string]interface{}{ + "name": "Node", + "data": map[string]interface{}{ "id": nativeToCypher(x.Id), "labels": nativeToCypher(x.Labels), "props": nativeToCypher(x.Props), }} + case neo4j.Relationship: + return map[string]interface{}{ + "name": "Relationship", + "data": map[string]interface{}{ + "id": nativeToCypher(x.Id), + "startNodeId": nativeToCypher(x.StartId), + "endNodeId": nativeToCypher(x.EndId), + "type": nativeToCypher(x.Type), + "props": nativeToCypher(x.Props), + }} + case neo4j.Path: + nodes := make([]interface{}, len(x.Nodes)) + for i := range x.Nodes { + nodes[i] = x.Nodes[i] + } + rels := make([]interface{}, len(x.Relationships)) + for i := range x.Relationships { + rels[i] = x.Relationships[i] + } + return map[string]interface{}{ + "name": "Path", + "data": map[string]interface{}{ + "nodes": nativeToCypher(nodes), + "relationships": nativeToCypher(rels), + }, + } } panic(fmt.Sprintf("Don't know how to patch %T", v)) }