Skip to content

Commit

Permalink
chore: fix CI (#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodus authored Sep 5, 2024
1 parent c45cab2 commit 6dd566b
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 36 deletions.
8 changes: 4 additions & 4 deletions src/network/indexer_indexing_poi_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ mod tests {

/// Test helper to get the testnet indexer url from the environment.
fn test_indexer_url() -> reqwest::Url {
std::env::var("IT_TEST_TESTNET_INDEXER_URL")
.expect("Missing IT_TEST_TESTNET_INDEXER_URL")
std::env::var("IT_TEST_UPGRADE_INDEXER_URL")
.expect("Missing IT_TEST_UPGRADE_INDEXER_URL")
.parse()
.expect("Invalid IT_TEST_TESTNET_INDEXER_URL")
.expect("Invalid IT_TEST_UPGRADE_INDEXER_URL")
}

#[test_with::env(IT_TEST_TESTNET_INDEXER_URL)]
#[test_with::env(IT_TEST_UPGRADE_INDEXER_URL)]
#[tokio::test]
async fn send_batched_queries_and_merge_results() {
//* Given
Expand Down
16 changes: 8 additions & 8 deletions src/network/indexer_indexing_progress_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,22 +194,22 @@ mod tests {

/// Test helper to get the testnet indexer url from the environment.
fn test_indexer_url() -> reqwest::Url {
std::env::var("IT_TEST_TESTNET_INDEXER_URL")
.expect("Missing IT_TEST_TESTNET_INDEXER_URL")
std::env::var("IT_TEST_UPGRADE_INDEXER_URL")
.expect("Missing IT_TEST_UPGRADE_INDEXER_URL")
.parse()
.expect("Invalid IT_TEST_TESTNET_INDEXER_URL")
.expect("Invalid IT_TEST_UPGRADE_INDEXER_URL")
}

#[test_with::env(IT_TEST_TESTNET_INDEXER_URL)]
#[test_with::env(IT_TEST_UPGRADE_INDEXER_URL)]
#[tokio::test]
async fn send_batched_queries_and_merge_results() {
//* Given
let client = reqwest::Client::new();
let status_url = indexers::status_url(test_indexer_url());

let test_deployments = [
deployment_id!("QmeYTH2fK2wv96XvnCGH2eyKFE8kmRfo53zYVy5dKysZtH"),
deployment_id!("QmSqxfDGyGenGFPkqw9sqnYar4XgzaioVWNvhw5QQ3RB1U"),
deployment_id!("QmSWxvd8SaQK6qZKJ7xtfxCCGoRzGnoi2WNzmJYYJW9BXY"),
deployment_id!("QmUhiH6Z5xo6o3GNzsSvqpGKLmCt6w5WzKQ1yHk6C8AA8S"),
];

//* When
Expand Down Expand Up @@ -237,7 +237,7 @@ mod tests {

assert_eq!(chain_status1.len(), 1);
let chain = &chain_status1[0];
assert_eq!(chain.network, "mainnet");
assert_eq!(chain.network, "arbitrum-one");
assert_matches!(chain.latest_block, Some(ref block) => {
assert!(block.number > 0);
});
Expand All @@ -254,7 +254,7 @@ mod tests {

assert_eq!(chain_status2.len(), 1);
let chain = &chain_status2[0];
assert_eq!(chain.network, "mainnet");
assert_eq!(chain.network, "arbitrum-one");
assert_matches!(chain.latest_block, Some(ref block) => {
assert!(block.number > 0);
});
Expand Down
8 changes: 4 additions & 4 deletions tests/it_indexers_cost_models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use url::Url;

/// Test helper to get the testnet indexer url from the environment.
fn test_indexer_url() -> Url {
std::env::var("IT_TEST_TESTNET_INDEXER_URL")
.expect("Missing IT_TEST_TESTNET_INDEXER_URL")
std::env::var("IT_TEST_UPGRADE_INDEXER_URL")
.expect("Missing IT_TEST_UPGRADE_INDEXER_URL")
.parse()
.expect("Invalid IT_TEST_TESTNET_INDEXER_URL")
.expect("Invalid IT_TEST_UPGRADE_INDEXER_URL")
}

#[test_with::env(IT_TEST_TESTNET_INDEXER_URL)]
#[test_with::env(IT_TEST_UPGRADE_INDEXER_URL)]
#[tokio::test]
async fn fetch_indexer_cost_models() {
//* Given
Expand Down
16 changes: 8 additions & 8 deletions tests/it_indexers_status_indexing_progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ use tokio::time::timeout;

/// Test helper to get the testnet indexer url from the environment.
fn test_indexer_url() -> reqwest::Url {
std::env::var("IT_TEST_TESTNET_INDEXER_URL")
.expect("Missing IT_TEST_TESTNET_INDEXER_URL")
std::env::var("IT_TEST_UPGRADE_INDEXER_URL")
.expect("Missing IT_TEST_UPGRADE_INDEXER_URL")
.parse()
.expect("Invalid IT_TEST_TESTNET_INDEXER_URL")
.expect("Invalid IT_TEST_UPGRADE_INDEXER_URL")
}

#[test_with::env(IT_TEST_TESTNET_INDEXER_URL)]
#[test_with::env(IT_TEST_UPGRADE_INDEXER_URL)]
#[tokio::test]
async fn fetch_indexer_indexing_progress() {
//* Given
let client = reqwest::Client::new();
let status_url = indexers::status_url(test_indexer_url());

let test_deployments = [
deployment_id!("QmeYTH2fK2wv96XvnCGH2eyKFE8kmRfo53zYVy5dKysZtH"),
deployment_id!("QmSqxfDGyGenGFPkqw9sqnYar4XgzaioVWNvhw5QQ3RB1U"),
deployment_id!("QmSWxvd8SaQK6qZKJ7xtfxCCGoRzGnoi2WNzmJYYJW9BXY"),
deployment_id!("QmUhiH6Z5xo6o3GNzsSvqpGKLmCt6w5WzKQ1yHk6C8AA8S"),
];

//* When
Expand All @@ -46,7 +46,7 @@ async fn fetch_indexer_indexing_progress() {

assert_eq!(status1.chains.len(), 1);
let chain = &status1.chains[0];
assert_eq!(chain.network, "mainnet");
assert_eq!(chain.network, "arbitrum-one");
assert_matches!(chain.latest_block, Some(ref block) => {
assert!(block.number > 0);
});
Expand All @@ -62,7 +62,7 @@ async fn fetch_indexer_indexing_progress() {

assert_eq!(status2.chains.len(), 1);
let chain = &status2.chains[0];
assert_eq!(chain.network, "mainnet");
assert_eq!(chain.network, "arbitrum-one");
assert_matches!(chain.latest_block, Some(ref block) => {
assert!(block.number > 0);
});
Expand Down
14 changes: 7 additions & 7 deletions tests/it_indexers_status_public_pois.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ use url::Url;

/// Test helper to get the testnet indexer url from the environment.
fn test_indexer_url() -> Url {
std::env::var("IT_TEST_TESTNET_INDEXER_URL")
.expect("Missing IT_TEST_TESTNET_INDEXER_URL")
std::env::var("IT_TEST_UPGRADE_INDEXER_URL")
.expect("Missing IT_TEST_UPGRADE_INDEXER_URL")
.parse()
.expect("Invalid IT_TEST_TESTNET_INDEXER_URL")
.expect("Invalid IT_TEST_UPGRADE_INDEXER_URL")
}

#[test_with::env(IT_TEST_TESTNET_INDEXER_URL)]
#[test_with::env(IT_TEST_UPGRADE_INDEXER_URL)]
#[tokio::test]
async fn query_indexer_public_pois() {
//* Given
let client = reqwest::Client::new();
let status_url = indexers::status_url(test_indexer_url());

let deployment0 = deployment_id!("QmeYTH2fK2wv96XvnCGH2eyKFE8kmRfo53zYVy5dKysZtH");
let deployment1 = deployment_id!("QmawxQJ5U1JvgosoFVDyAwutLWxrckqVmBTQxaMaKoj3Lw");
let deployment0 = deployment_id!("QmSWxvd8SaQK6qZKJ7xtfxCCGoRzGnoi2WNzmJYYJW9BXY");
let deployment1 = deployment_id!("QmUhiH6Z5xo6o3GNzsSvqpGKLmCt6w5WzKQ1yHk6C8AA8S");
let query = [(deployment0, 123), (deployment1, 456)];

//* When
Expand All @@ -46,7 +46,7 @@ async fn query_indexer_public_pois() {

/// Indexers do not support more than 10 requests at a time. It returns a 500 Internal Server
/// Error with the following message: "query is too expensive".
#[test_with::env(IT_TEST_TESTNET_INDEXER_URL)]
#[test_with::env(IT_TEST_UPGRADE_INDEXER_URL)]
#[tokio::test]
async fn requests_over_max_requests_per_query_should_fail() {
//* Given
Expand Down
10 changes: 5 additions & 5 deletions tests/it_indexers_status_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ use url::Url;

/// Test helper to get the testnet indexer url from the environment.
fn test_indexer_url() -> Url {
std::env::var("IT_TEST_TESTNET_INDEXER_URL")
.expect("Missing IT_TEST_TESTNET_INDEXER_URL")
std::env::var("IT_TEST_UPGRADE_INDEXER_URL")
.expect("Missing IT_TEST_UPGRADE_INDEXER_URL")
.parse()
.expect("Invalid IT_TEST_TESTNET_INDEXER_URL")
.expect("Invalid IT_TEST_UPGRADE_INDEXER_URL")
}

#[test_with::env(IT_TEST_TESTNET_INDEXER_URL)]
#[test_with::env(IT_TEST_UPGRADE_INDEXER_URL)]
#[tokio::test]
async fn query_indexer_service_version() {
//* Given
Expand All @@ -35,7 +35,7 @@ async fn query_indexer_service_version() {
});
}

#[test_with::env(IT_TEST_TESTNET_INDEXER_URL)]
#[test_with::env(IT_TEST_UPGRADE_INDEXER_URL)]
#[tokio::test]
async fn query_graph_node_version() {
//* Given
Expand Down

0 comments on commit 6dd566b

Please sign in to comment.