Skip to content

Commit

Permalink
TEMP - rootstore size
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Sep 30, 2024
1 parent dc004d9 commit 15bc376
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 3 deletions.
53 changes: 50 additions & 3 deletions tests/integration/mutation/create/simple_create_many_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,68 @@ func TestMutationCreateMany(t *testing.T) {
type Users {
name: String
age: Int
email: String
}
`,
},
testUtils.CreateDoc{
Doc: `[
{
"name": "John",
"age": 27
"age": 27,
"email": "foo"
},
{
"name": "Islam",
"age": 33
"name": "Islam1",
"age": 27,
"email": "foo"
},
{
"name": "Islam2",
"age": 27,
"email": "foo"
},
{
"name": "Islam3",
"age": 27,
"email": "foo"
},
{
"name": "Islam4",
"age": 27,
"email": "foo"
},
{
"name": "Islam5",
"age": 27,
"email": "foo"
},
{
"name": "Islam6",
"age": 27,
"email": "foo"
},
{
"name": "Islam7",
"age": 27,
"email": "foo"
},
{
"name": "Islam8",
"age": 27,
"email": "foo"
},
{
"name": "Islam9",
"age": 27,
"email": "foo"
}
]`,
},
testUtils.UpdateWithFilter{
Filter: `{age: {_eq: 27}}`,
Updater: `{"age": 28}`,
},
testUtils.Request{
Request: `
query {
Expand Down
16 changes: 16 additions & 0 deletions tests/integration/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"time"

"github.com/fxamacker/cbor/v2"
"github.com/ipfs/go-datastore/query"
"github.com/sourcenetwork/corelog"
"github.com/sourcenetwork/immutable"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -1957,6 +1958,21 @@ func executeRequest(
identity := getIdentity(s, nodeID, action.Identity)
ctx = db.SetContextIdentity(ctx, identity)

r, e := node.Rootstore().Query(ctx, query.Query{
Prefix: "/db/blocks",
})
if e != nil {
panic(e.Error())
}

t := 0
rr, h := r.NextSync()
for h {
t += rr.Size
rr, h = r.NextSync()
}
panic(fmt.Sprint(t))

var options []client.RequestOption

Check failure on line 1976 in tests/integration/utils.go

View workflow job for this annotation

GitHub Actions / Lint GoLang job

unreachable: unreachable code (govet)
if action.OperationName.HasValue() {
options = append(options, client.WithOperationName(action.OperationName.Value()))
Expand Down

0 comments on commit 15bc376

Please sign in to comment.