Skip to content

Commit 207e31f

Browse files
committed
server: Make deployment_info test work in sharded setup
1 parent 605c6d2 commit 207e31f

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

server/graphman/tests/deployment_query.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
pub mod util;
22

3+
use graph::components::store::{QueryStoreManager, SubgraphStore};
34
use graph::data::subgraph::DeploymentHash;
5+
use graph::prelude::QueryTarget;
6+
47
use serde_json::json;
58
use test_store::store::create_test_subgraph;
69
use test_store::store::NETWORK_NAME;
7-
use test_store::store::NODE_ID;
10+
use test_store::STORE;
11+
use test_store::SUBGRAPH_STORE;
812

913
use self::util::client::send_graphql_request;
1014
use self::util::run_test;
@@ -54,6 +58,15 @@ fn graphql_returns_deployment_info() {
5458
.await;
5559

5660
let namespace = format!("sgd{}", locator.id);
61+
let node = SUBGRAPH_STORE.assigned_node(&locator).unwrap().unwrap();
62+
let qs = STORE
63+
.query_store(
64+
QueryTarget::Deployment(locator.hash.clone(), Default::default()),
65+
false,
66+
)
67+
.await
68+
.expect("could get a query store");
69+
let shard = qs.shard();
5770

5871
let expected_resp = json!({
5972
"data": {
@@ -63,8 +76,8 @@ fn graphql_returns_deployment_info() {
6376
"hash": "subgraph_1",
6477
"namespace": namespace,
6578
"name": "subgraph_1",
66-
"nodeId": NODE_ID.to_string(),
67-
"shard": "primary",
79+
"nodeId": node.to_string(),
80+
"shard": shard,
6881
"chain": NETWORK_NAME,
6982
"versionStatus": "current",
7083
"isActive": true,

0 commit comments

Comments
 (0)