Skip to content

Commit

Permalink
fixed integration test failure issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Solender committed May 27, 2021
1 parent ed14e83 commit 8a36bf6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ jobs:
- name: Run Unit Tests
run: go test ./... -cover -short

# - name: Start Neo4j V3 Docker
# run: |
# docker-compose -f .github/docker-compose-v3.yaml up -d
# - name: Wait for neo4j v3 to be ready
# run: |
# sleep 45
# - name: Run Integration Test on V3
# run: go test ./... -cover -run Integration
# - name: Stop Neo4j Docker on v3
# run: |
# docker-compose -f .github/docker-compose-v3.yaml down --remove-orphans
- name: Start Neo4j V3 Docker
run: |
docker-compose -f .github/docker-compose-v3.yaml up -d
- name: Wait for neo4j v3 to be ready
run: |
sleep 45
- name: Run Integration Test on V3
run: go test ./... -cover -run Integration
- name: Stop Neo4j Docker on v3
run: |
docker-compose -f .github/docker-compose-v3.yaml down --remove-orphans
- name: Start Neo4j V4 Docker
run: |
Expand Down
8 changes: 4 additions & 4 deletions interfacev2.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ type TransactionV2 interface {

type ogmFunctions interface {
//load single object
Load(ctx context.Context, respObj , id interface{},) error
Load(ctx context.Context, respObj, id interface{}) error

//load object with depth
LoadDepth(ctx context.Context, respObj , id interface{}, depth int) error
LoadDepth(ctx context.Context, respObj, id interface{}, depth int) error

//load with depth and filter
LoadDepthFilter(ctx context.Context,respObj , id interface{}, depth int, filter *dsl.ConditionBuilder, params map[string]interface{}) error
LoadDepthFilter(ctx context.Context, respObj, id interface{}, depth int, filter *dsl.ConditionBuilder, params map[string]interface{}) error

//load with depth, filter and pagination
LoadDepthFilterPagination(ctx context.Context, respObj , id interface{}, depth int, filter dsl.ConditionOperator, params map[string]interface{}, pagination *Pagination) error
LoadDepthFilterPagination(ctx context.Context, respObj, id interface{}, depth int, filter dsl.ConditionOperator, params map[string]interface{}, pagination *Pagination) error

//load slice of something
LoadAll(ctx context.Context, respObj interface{}) error
Expand Down
2 changes: 1 addition & 1 deletion load_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func PathLoadStrategyOne(variable, label, fieldOn, paramName string, isGraphId b
Name: variable,
Field: fieldOn,
ConditionOperator: dsl.EqualToOperator,
Check: dsl.ParamString("$" + paramName) ,
Check: dsl.ParamString("$" + paramName),
}
}

Expand Down
8 changes: 4 additions & 4 deletions save.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ func relateNodes(transaction neo4j.Transaction, relations map[string][]*relCreat
"rows": params,
})
if err != nil {
return err
return fmt.Errorf("failed to relate nodes, %w", err)
} else if err = res.Err(); err != nil {
return err
return fmt.Errorf("failed to relate nodes %w", res.Err())
}
}

Expand Down Expand Up @@ -279,7 +279,7 @@ func removeRelations(transaction neo4j.Transaction, dels map[int64][]int64) erro
}).V(dsl.V{
Name: "end",
}).Build()).
Cypher("WHERE id(start) in row.startNodeId and id(end) IN row.endNodeIds").
Cypher("WHERE id(start) = row.startNodeId and id(end) = row.endNodeIds").
Delete(false, "e").
ToCypher()
if err != nil {
Expand Down Expand Up @@ -563,7 +563,7 @@ func createNodes(transaction neo4j.Transaction, crNodes map[string]map[uintptr]*
cyp, err := dsl.QB().
Cypher("UNWIND $rows as row").
Cypher(fmt.Sprintf("MATCH %s", path)).
Cypher("WHERE ID(n) in row.id").
Cypher("WHERE ID(n) = row.id").
Cypher("SET n += row.obj").
ToCypher()

Expand Down
8 changes: 4 additions & 4 deletions sessionv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (s *SessionV2Impl) Commit(ctx context.Context) error {
return nil
}

func (s *SessionV2Impl) Load(ctx context.Context, respObj , id interface{}) error {
func (s *SessionV2Impl) Load(ctx context.Context, respObj, id interface{}) error {
var span opentracing.Span
if ctx != nil && s.gogm.config.OpentracingEnabled {
span, ctx = opentracing.StartSpanFromContext(ctx, "gogm.SessionV2Impl.Load")
Expand All @@ -187,7 +187,7 @@ func (s *SessionV2Impl) Load(ctx context.Context, respObj , id interface{}) erro
return s.LoadDepthFilterPagination(ctx, respObj, id, s.DefaultDepth, nil, nil, nil)
}

func (s *SessionV2Impl) LoadDepth(ctx context.Context, respObj , id interface{}, depth int) error {
func (s *SessionV2Impl) LoadDepth(ctx context.Context, respObj, id interface{}, depth int) error {
var span opentracing.Span
if ctx != nil && s.gogm.config.OpentracingEnabled {
span, ctx = opentracing.StartSpanFromContext(ctx, "gogm.SessionV2Impl.LoadDepth")
Expand All @@ -199,7 +199,7 @@ func (s *SessionV2Impl) LoadDepth(ctx context.Context, respObj , id interface{},
return s.LoadDepthFilterPagination(ctx, respObj, id, depth, nil, nil, nil)
}

func (s *SessionV2Impl) LoadDepthFilter(ctx context.Context, respObj , id interface{}, depth int, filter *dsl.ConditionBuilder, params map[string]interface{}) error {
func (s *SessionV2Impl) LoadDepthFilter(ctx context.Context, respObj, id interface{}, depth int, filter *dsl.ConditionBuilder, params map[string]interface{}) error {
var span opentracing.Span
if ctx != nil && s.gogm.config.OpentracingEnabled {
span, ctx = opentracing.StartSpanFromContext(ctx, "gogm.SessionV2Impl.LoadDepthFilter")
Expand All @@ -211,7 +211,7 @@ func (s *SessionV2Impl) LoadDepthFilter(ctx context.Context, respObj , id interf
return s.LoadDepthFilterPagination(ctx, respObj, id, depth, filter, params, nil)
}

func (s *SessionV2Impl) LoadDepthFilterPagination(ctx context.Context, respObj , id interface{}, depth int, filter dsl.ConditionOperator, params map[string]interface{}, pagination *Pagination) error {
func (s *SessionV2Impl) LoadDepthFilterPagination(ctx context.Context, respObj, id interface{}, depth int, filter dsl.ConditionOperator, params map[string]interface{}, pagination *Pagination) error {
var span opentracing.Span
if ctx != nil && s.gogm.config.OpentracingEnabled {
span, ctx = opentracing.StartSpanFromContext(ctx, "gogm.SessionV2Impl.LoadDepthFilterPagination")
Expand Down

0 comments on commit 8a36bf6

Please sign in to comment.