-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
decouple transactional test runner from indexer and graphql flavor (#…
- Loading branch information
Showing
11 changed files
with
355 additions
and
142 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
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
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
30 changes: 30 additions & 0 deletions
30
crates/sui-transactional-test-runner/src/offchain_state.rs
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 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use async_trait::async_trait; | ||
use std::time::Duration; | ||
|
||
pub struct TestResponse { | ||
pub response_body: String, | ||
pub http_headers: Option<http::HeaderMap>, | ||
pub service_version: Option<String>, | ||
} | ||
|
||
/// Trait for interacting with the offchain state of the Sui network. To reduce test flakiness, | ||
/// these methods are used in the `RunGraphqlCommand` to stabilize the off-chain indexed state. | ||
#[async_trait] | ||
pub trait OffchainStateReader: Send + Sync + 'static { | ||
/// Polls the objects snapshot table until it is within the allowed lag from the latest | ||
/// checkpoint. | ||
async fn wait_for_objects_snapshot_catchup(&self, base_timeout: Duration); | ||
/// Polls the checkpoint table until the given checkpoint is committed. | ||
async fn wait_for_checkpoint_catchup(&self, checkpoint: u64, base_timeout: Duration); | ||
/// Polls the checkpoint table until the given checkpoint is pruned. | ||
async fn wait_for_pruned_checkpoint(&self, checkpoint: u64, base_timeout: Duration); | ||
/// Executes a GraphQL query and returns the response. | ||
async fn execute_graphql( | ||
&self, | ||
query: String, | ||
show_usage: bool, | ||
) -> Result<TestResponse, anyhow::Error>; | ||
} |
Oops, something went wrong.