Skip to content

Commit

Permalink
Remove unrelated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
islamaliev committed May 30, 2023
1 parent 452cec7 commit 6710210
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
23 changes: 2 additions & 21 deletions tests/integration/test_case.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
package tests

import (
"testing"

"github.com/sourcenetwork/immutable"

"github.com/sourcenetwork/defradb/config"
Expand Down Expand Up @@ -153,20 +151,6 @@ type UpdateDoc struct {
DontSync bool
}

// ResultAsserter is an interface that can be implemented to provide custom result
// assertions.
type ResultAsserter interface {
// Assert will be called with the test and the result of the request.
Assert(t *testing.T, result []map[string]any)
}

// ResultAsserterFunc is a function that can be used to implement the ResultAsserter
type ResultAsserterFunc func(*testing.T, []map[string]any) (bool, string)

func (f ResultAsserterFunc) Assert(t *testing.T, result []map[string]any) {
f(t, result)
}

// Request represents a standard Defra (GQL) request.
type Request struct {
// NodeID may hold the ID (index) of a node to execute this request on.
Expand All @@ -181,9 +165,6 @@ type Request struct {
// The expected (data) results of the issued request.
Results []map[string]any

// Asserter is an optional custom result asserter.
Asserter ResultAsserter

// Any error expected from the action. Optional.
//
// String can be a partial, and the test will pass if an error is returned that
Expand All @@ -195,8 +176,8 @@ type Request struct {
//
// A new transaction will be created for the first TransactionRequest2 of any given
// TransactionId. TransactionRequest2s will be submitted to the database in the order
// in which they are received (interleaving amongst other actions if provided), however
// they will not be committed until a TransactionCommit of matching TransactionId is
// in which they are recieved (interleaving amongst other actions if provided), however
// they will not be commited until a TransactionCommit of matching TransactionId is
// provided.
type TransactionRequest2 struct {
// Used to identify the transaction for this to run against.
Expand Down
9 changes: 0 additions & 9 deletions tests/integration/utils2.go
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,6 @@ func executeTransactionRequest(
&result.GQL,
action.Results,
action.ExpectedError,
nil,
// anyof is not yet supported by transactional requests
0,
map[docFieldKey][]any{},
Expand Down Expand Up @@ -1073,7 +1072,6 @@ func executeRequest(
&result.GQL,
action.Results,
action.ExpectedError,
action.Asserter,
nodeID,
anyOfByFieldKey,
)
Expand Down Expand Up @@ -1144,7 +1142,6 @@ func executeSubscriptionRequest(
finalResult,
action.Results,
action.ExpectedError,
nil,
// anyof is not yet supported by subscription requests
0,
map[docFieldKey][]any{},
Expand Down Expand Up @@ -1218,7 +1215,6 @@ func assertRequestResults(
result *client.GQLResult,
expectedResults []map[string]any,
expectedError string,
asserter ResultAsserter,
nodeID int,
anyOfByField map[docFieldKey][]any,
) bool {
Expand All @@ -1233,11 +1229,6 @@ func assertRequestResults(
// Note: if result.Data == nil this panics (the panic seems useful while testing).
resultantData := result.Data.([]map[string]any)

if asserter != nil {
asserter.Assert(t, resultantData)
return true
}

log.Info(ctx, "", logging.NewKV("RequestResults", result.Data))

// compare results
Expand Down

0 comments on commit 6710210

Please sign in to comment.