-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description Set-up transactional tests for Indexer-Alt and RPC-Alt ## Test plan Run the new transactional tests: ``` sui$ cargo nextest run -p sui-indexer-alt-e2e-tests ```
- Loading branch information
Showing
11 changed files
with
448 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[package] | ||
name = "sui-indexer-alt-e2e-tests" | ||
version = "0.1.0" | ||
authors = ["Mysten Labs <[email protected]>"] | ||
license = "Apache-2.0" | ||
publish = false | ||
edition = "2021" | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[[test]] | ||
name = "tests" | ||
harness = false | ||
|
||
[dependencies] | ||
|
||
[target.'cfg(msim)'.dependencies] | ||
msim.workspace = true | ||
|
||
[dev-dependencies] | ||
anyhow.workspace = true | ||
async-trait.workspace = true | ||
datatest-stable.workspace = true | ||
diesel = { workspace = true, features = ["chrono"] } | ||
diesel-async = { workspace = true, features = ["bb8", "postgres", "async-connection-wrapper"] } | ||
prometheus.workspace = true | ||
reqwest.workspace = true | ||
serde_json.workspace = true | ||
telemetry-subscribers.workspace = true | ||
tokio.workspace = true | ||
tokio-util.workspace = true | ||
url.workspace = true | ||
|
||
sui-indexer-alt.workspace = true | ||
sui-indexer-alt-framework.workspace = true | ||
sui-indexer-alt-jsonrpc.workspace = true | ||
sui-pg-db.workspace = true | ||
sui-transactional-test-runner.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#![forbid(unsafe_code)] | ||
|
||
// Empty src/lib.rs to get rusty-tags working. |
9 changes: 9 additions & 0 deletions
9
crates/sui-indexer-alt-e2e-tests/tests/jsonrpc/governance/custom_rgp.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
processed 2 tasks | ||
|
||
task 1, lines 6-10: | ||
//# run-jsonrpc | ||
Response: { | ||
"jsonrpc": "2.0", | ||
"id": 0, | ||
"result": "1337" | ||
} |
10 changes: 10 additions & 0 deletions
10
crates/sui-indexer-alt-e2e-tests/tests/jsonrpc/governance/custom_rgp.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# init --protocol-version 70 --simulator --objects-snapshot-min-checkpoint-lag 2 --reference-gas-price 1337 | ||
|
||
//# run-jsonrpc | ||
{ | ||
"method": "suix_getReferenceGasPrice", | ||
"params": [] | ||
} |
9 changes: 9 additions & 0 deletions
9
crates/sui-indexer-alt-e2e-tests/tests/jsonrpc/governance/default_rgp.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
processed 2 tasks | ||
|
||
task 1, lines 6-10: | ||
//# run-jsonrpc | ||
Response: { | ||
"jsonrpc": "2.0", | ||
"id": 0, | ||
"result": "1000" | ||
} |
10 changes: 10 additions & 0 deletions
10
crates/sui-indexer-alt-e2e-tests/tests/jsonrpc/governance/default_rgp.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# init --protocol-version 70 --simulator --objects-snapshot-min-checkpoint-lag 2 | ||
|
||
//# run-jsonrpc | ||
{ | ||
"method": "suix_getReferenceGasPrice", | ||
"params": [] | ||
} |
30 changes: 30 additions & 0 deletions
30
crates/sui-indexer-alt-e2e-tests/tests/jsonrpc/test_framework/framework.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
processed 6 tasks | ||
|
||
task 1, lines 19-22: | ||
//# run-graphql | ||
Error: GraphQL queries are not supported in these tests | ||
|
||
task 2, line 24: | ||
//# run-jsonrpc | ||
Error: Missing JSON-RPC query | ||
|
||
task 3, lines 26-29: | ||
//# run-jsonrpc | ||
Error: Failed to parse JSON-RPC query | ||
|
||
task 4, lines 31-35: | ||
//# run-jsonrpc | ||
Error: Failed to parse JSON-RPC query | ||
|
||
task 5, lines 37-41: | ||
//# run-jsonrpc --show-headers | ||
Headers: { | ||
"content-type": "application/json; charset=utf-8", | ||
"content-length": "40", | ||
} | ||
|
||
Response: { | ||
"jsonrpc": "2.0", | ||
"id": 0, | ||
"result": "1000" | ||
} |
41 changes: 41 additions & 0 deletions
41
crates/sui-indexer-alt-e2e-tests/tests/jsonrpc/test_framework/framework.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# init --protocol-version 70 --simulator --objects-snapshot-min-checkpoint-lag 2 | ||
|
||
// This test is checking details about the test runner: | ||
// | ||
// (1) It does not support GraphQL queries. | ||
// (2) Tests will fail if the JSON-RPC query does not contian methods or | ||
// params. | ||
// - No JSON object. | ||
// - Missing params. | ||
// - Extra trailing comma (tricky!) | ||
// (3) Displaying response headers is supported. | ||
// | ||
// The test description is at the top because the JSON does not have explicit | ||
// syntax for comments. | ||
|
||
//# run-graphql | ||
{ | ||
chainIdentifier | ||
} | ||
|
||
//# run-jsonrpc | ||
|
||
//# run-jsonrpc | ||
{ | ||
"method": "suix_getReferenceGasPrice" | ||
} | ||
|
||
//# run-jsonrpc | ||
{ | ||
"method": "suix_getReferenceGasPrice", | ||
"params": [], | ||
} | ||
|
||
//# run-jsonrpc --show-headers | ||
{ | ||
"method": "suix_getReferenceGasPrice", | ||
"params": [] | ||
} |
Oops, something went wrong.