Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testkit fixes #258

Merged
merged 2 commits into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion testkit-backend/2cypher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
1 change: 0 additions & 1 deletion testkit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down