Skip to content

Commit

Permalink
server: Make deployment_info test work in sharded setup
Browse files Browse the repository at this point in the history
  • Loading branch information
lutter committed Oct 25, 2024
1 parent 605c6d2 commit 207e31f
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions server/graphman/tests/deployment_query.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
pub mod util;

use graph::components::store::{QueryStoreManager, SubgraphStore};
use graph::data::subgraph::DeploymentHash;
use graph::prelude::QueryTarget;

use serde_json::json;
use test_store::store::create_test_subgraph;
use test_store::store::NETWORK_NAME;
use test_store::store::NODE_ID;
use test_store::STORE;
use test_store::SUBGRAPH_STORE;

use self::util::client::send_graphql_request;
use self::util::run_test;
Expand Down Expand Up @@ -54,6 +58,15 @@ fn graphql_returns_deployment_info() {
.await;

let namespace = format!("sgd{}", locator.id);
let node = SUBGRAPH_STORE.assigned_node(&locator).unwrap().unwrap();
let qs = STORE
.query_store(
QueryTarget::Deployment(locator.hash.clone(), Default::default()),
false,
)
.await
.expect("could get a query store");
let shard = qs.shard();

let expected_resp = json!({
"data": {
Expand All @@ -63,8 +76,8 @@ fn graphql_returns_deployment_info() {
"hash": "subgraph_1",
"namespace": namespace,
"name": "subgraph_1",
"nodeId": NODE_ID.to_string(),
"shard": "primary",
"nodeId": node.to_string(),
"shard": shard,
"chain": NETWORK_NAME,
"versionStatus": "current",
"isActive": true,
Expand Down

0 comments on commit 207e31f

Please sign in to comment.