Skip to content

Commit

Permalink
fix(iota-graphql-e2e-tests): restore graphql e2e tests (#1969)
Browse files Browse the repository at this point in the history
* refactor(iota-graphql-e2e-test): update baseline for available_range tests

* fix(iota-transactional-test-runner): use no padding while encoding graphql json cursors

* refactor(iota-graphql-e2e-test): update baseline for call tests

* refactor(iota-graphql-e2e-test): update baseline for consistency tests

* refactor(iota-graphql-e2e-test): update baseline for epoch tests

* refactor(iota-graphql-e2e-test): update baseline for event_connection tests

* refactor(iota-graphql-e2e-test): update baseline for limits tests

* refactor(iota-graphql-e2e-test): update baseline for objects tests

* refactor(iota-graphql-e2e-test): update baseline for owners tests

* refactor(iota-graphql-e2e-test): update baseline for packages tests

* refactor(iota-graphql-e2e-test): update baseline for transaction_block_effects tests

* refactor(iota-graphql-e2e-test): update baseline for transactions tests

* refactor(docker): allow overriding postgres env variables

* refactor(iota-graphql-e2e-tests): update README

* fixup! refactor(iota-graphql-e2e-tests): update README

* fixup! refactor(docker): allow overriding postgres env variables

* fix(iota-graphql-e2e-test): fixed `objects/pagination.move` test

* fix(graphql-e2e-test): remove obsolete name service tests

---------

Co-authored-by: Valerii Reutov <[email protected]>
Co-authored-by: Levente Pap <[email protected]>
  • Loading branch information
3 people authored Aug 27, 2024
1 parent 0603cd8 commit 4a36618
Show file tree
Hide file tree
Showing 52 changed files with 1,882 additions and 1,889 deletions.
40 changes: 11 additions & 29 deletions crates/iota-graphql-e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,25 @@ runner.
# Local Set-up

These tests require a running instance of the `postgres` service, with a
database set-up. The instructions below assume that `postgres` has been
installed using `brew`:
database set-up.

1. See the instructions in the Iota Indexer [README](../iota-indexer/README.md)
for pre-requisites and starting the Postgres service.
It is recommended that the database server is started in a docker container.

2. When postgres is initially installed, it creates a role for your current
user. We need to use that role to create the role that will access the
database:
## Using `docker compose`

```sh
$ ME=$(whoami)
$ psql "postgres://$ME:$ME@localhost:5432/postgres" \
-c "CREATE ROLE postgres WITH SUPERUSER LOGIN PASSWORD 'postgrespw';"
$ POSTGRES_USER=postgres POSTGRES_DB=postgres POSTGRES_PASSWORD=postgrespw POSTGRES_INITDB_ARGS="-U postgres" docker compose -f docker/pg-services-local/docker-compose.yaml up -d postgres
```

3. Then, create the database that the tests expect, using the `postgres` user
and increase the max connections since many tests might run in parallel.
## Using `docker`

```sh
$ psql "postgres://postgres:postgrespw@localhost:5432/postgres" \
-c "CREATE DATABASE iota_indexer_v2;" -c "ALTER SYSTEM SET max_connections = 500;"
```

4. Finally, restart the `postgres` server so the max connections change takes
effect.

Mac

```sh
brew services restart postgresql@15
```

Linux

```sh
/etc/init.d/postgresql restart
docker run -d --name postgres \
-e POSTGRES_PASSWORD=postgrespw \
-e POSTGRES_INITDB_ARGS="-U postgres" \
-p 5432:5432 \
postgres:15 \
-c max_connections=1000
```

# Running Locally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ Response: {
"data": {
"availableRange": {
"first": {
"digest": "5YXraQV5WesywS2GaHPgeTiFrq1jzZ4grxdGKwi9gVM2",
"digest": "GScMjNWDfxk3zKFB83PrCC2nh2UWWpRpGD2iF8qxsSWC",
"sequenceNumber": 0
},
"last": {
"digest": "5YXraQV5WesywS2GaHPgeTiFrq1jzZ4grxdGKwi9gVM2",
"digest": "GScMjNWDfxk3zKFB83PrCC2nh2UWWpRpGD2iF8qxsSWC",
"sequenceNumber": 0
}
},
"first": {
"digest": "5YXraQV5WesywS2GaHPgeTiFrq1jzZ4grxdGKwi9gVM2",
"digest": "GScMjNWDfxk3zKFB83PrCC2nh2UWWpRpGD2iF8qxsSWC",
"sequenceNumber": 0
},
"last": {
"digest": "5YXraQV5WesywS2GaHPgeTiFrq1jzZ4grxdGKwi9gVM2",
"digest": "GScMjNWDfxk3zKFB83PrCC2nh2UWWpRpGD2iF8qxsSWC",
"sequenceNumber": 0
}
}
Expand All @@ -35,20 +35,20 @@ Response: {
"data": {
"availableRange": {
"first": {
"digest": "5YXraQV5WesywS2GaHPgeTiFrq1jzZ4grxdGKwi9gVM2",
"digest": "GScMjNWDfxk3zKFB83PrCC2nh2UWWpRpGD2iF8qxsSWC",
"sequenceNumber": 0
},
"last": {
"digest": "2uu5ba8PLyPjJUwwBdzt4Zm2yjNyrWwULEPQTq32Fzt2",
"digest": "6jrWPojSy4Qn6z3SpC39MPUygjRre6eoQGu3XmfuxwxH",
"sequenceNumber": 2
}
},
"first": {
"digest": "5YXraQV5WesywS2GaHPgeTiFrq1jzZ4grxdGKwi9gVM2",
"digest": "GScMjNWDfxk3zKFB83PrCC2nh2UWWpRpGD2iF8qxsSWC",
"sequenceNumber": 0
},
"last": {
"digest": "2uu5ba8PLyPjJUwwBdzt4Zm2yjNyrWwULEPQTq32Fzt2",
"digest": "6jrWPojSy4Qn6z3SpC39MPUygjRre6eoQGu3XmfuxwxH",
"sequenceNumber": 2
}
}
Expand Down
60 changes: 30 additions & 30 deletions crates/iota-graphql-e2e-tests/tests/call/dynamic_fields.exp
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,26 @@ Response: {
{
"name": {
"type": {
"repr": "u64"
"repr": "bool"
},
"data": {
"Number": "0"
"Bool": false
},
"bcs": "AAAAAAAAAAA="
"bcs": "AA=="
},
"value": {
"__typename": "MoveObject"
"__typename": "MoveValue"
}
},
{
"name": {
"type": {
"repr": "bool"
"repr": "u64"
},
"data": {
"Bool": false
"Number": "0"
},
"bcs": "AA=="
"bcs": "AAAAAAAAAAA="
},
"value": {
"__typename": "MoveValue"
Expand Down Expand Up @@ -85,7 +85,7 @@ Response: {
"bcs": "AAAAAAAAAAA="
},
"value": {
"__typename": "MoveValue"
"__typename": "MoveObject"
}
}
]
Expand All @@ -112,26 +112,26 @@ Response: {
{
"name": {
"type": {
"repr": "u64"
"repr": "bool"
},
"data": {
"Number": "0"
"Bool": false
},
"bcs": "AAAAAAAAAAA="
"bcs": "AA=="
},
"value": {
"__typename": "MoveObject"
"__typename": "MoveValue"
}
},
{
"name": {
"type": {
"repr": "bool"
"repr": "u64"
},
"data": {
"Bool": false
"Number": "0"
},
"bcs": "AA=="
"bcs": "AAAAAAAAAAA="
},
"value": {
"__typename": "MoveValue"
Expand Down Expand Up @@ -162,7 +162,7 @@ Response: {
"bcs": "AAAAAAAAAAA="
},
"value": {
"__typename": "MoveValue"
"__typename": "MoveObject"
}
}
]
Expand All @@ -180,31 +180,35 @@ Response: {
{
"name": {
"type": {
"repr": "u64"
"repr": "bool"
},
"data": {
"Number": "0"
"Bool": false
},
"bcs": "AAAAAAAAAAA="
"bcs": "AA=="
},
"value": {
"__typename": "MoveObject"
"bcs": "AgAAAAAAAAA=",
"data": {
"Number": "2"
},
"__typename": "MoveValue"
}
},
{
"name": {
"type": {
"repr": "bool"
"repr": "u64"
},
"data": {
"Bool": false
"Number": "0"
},
"bcs": "AA=="
"bcs": "AAAAAAAAAAA="
},
"value": {
"bcs": "AgAAAAAAAAA=",
"bcs": "AAAAAAAAAAA=",
"data": {
"Number": "2"
"Number": "0"
},
"__typename": "MoveValue"
}
Expand Down Expand Up @@ -238,11 +242,7 @@ Response: {
"bcs": "AAAAAAAAAAA="
},
"value": {
"bcs": "AAAAAAAAAAA=",
"data": {
"Number": "0"
},
"__typename": "MoveValue"
"__typename": "MoveObject"
}
}
]
Expand Down
Loading

0 comments on commit 4a36618

Please sign in to comment.