Skip to content

Commit

Permalink
tests: Remove runner test for subgraph datasources
Browse files Browse the repository at this point in the history
  • Loading branch information
incrypto32 committed Jan 20, 2025
1 parent 3944111 commit 743a451
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 140 deletions.
15 changes: 0 additions & 15 deletions tests/runner-tests/subgraph-data-sources/abis/Contract.abi

This file was deleted.

13 changes: 0 additions & 13 deletions tests/runner-tests/subgraph-data-sources/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions tests/runner-tests/subgraph-data-sources/schema.graphql

This file was deleted.

35 changes: 0 additions & 35 deletions tests/runner-tests/subgraph-data-sources/src/mapping.ts

This file was deleted.

19 changes: 0 additions & 19 deletions tests/runner-tests/subgraph-data-sources/subgraph.yaml

This file was deleted.

55 changes: 3 additions & 52 deletions tests/tests/runner_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::sync::Arc;
use std::time::Duration;

use assert_json_diff::assert_json_eq;
use graph::blockchain::block_stream::{BlockWithTriggers, EntityOperationKind};
use graph::blockchain::block_stream::BlockWithTriggers;
use graph::blockchain::{Block, BlockPtr, Blockchain};
use graph::data::store::scalar::Bytes;
use graph::data::subgraph::schema::{SubgraphError, SubgraphHealth};
Expand All @@ -18,12 +18,11 @@ use graph::object;
use graph::prelude::ethabi::ethereum_types::H256;
use graph::prelude::web3::types::Address;
use graph::prelude::{
hex, CheapClone, DeploymentHash, SubgraphAssignmentProvider, SubgraphName, SubgraphStore, Value,
hex, CheapClone, DeploymentHash, SubgraphAssignmentProvider, SubgraphName, SubgraphStore,
};
use graph::schema::InputSchema;
use graph_tests::fixture::ethereum::{
chain, empty_block, generate_empty_blocks_for_range, genesis, push_test_command, push_test_log,
push_test_polling_trigger, push_test_subgraph_trigger,
push_test_polling_trigger,
};

use graph_tests::fixture::substreams::chain as substreams_chain;
Expand Down Expand Up @@ -1091,54 +1090,6 @@ async fn parse_data_source_context() {
);
}

#[tokio::test]
async fn subgraph_data_sources() {
let RunnerTestRecipe { stores, test_info } =
RunnerTestRecipe::new("subgraph-data-sources", "subgraph-data-sources").await;

let schema = InputSchema::parse_latest(
"type User @entity { id: String!, val: String! }",
DeploymentHash::new("test").unwrap(),
)
.unwrap();

let entity = schema
.make_entity(vec![
("id".into(), Value::String("id".to_owned())),
("val".into(), Value::String("DATA".to_owned())),
])
.unwrap();

let entity_type = schema.entity_type("User").unwrap();

let blocks = {
let block_0 = genesis();
let mut block_1 = empty_block(block_0.ptr(), test_ptr(1));

push_test_subgraph_trigger(
&mut block_1,
DeploymentHash::new("QmRFXhvyvbm4z5Lo7z2mN9Ckmo623uuB2jJYbRmAXgYKXJ").unwrap(),
entity,
entity_type,
EntityOperationKind::Create,
1,
);

let block_2 = empty_block(block_1.ptr(), test_ptr(2));
vec![block_0, block_1, block_2]
};
let stop_block = blocks.last().unwrap().block.ptr();
let chain = chain(&test_info.test_name, blocks, &stores, None).await;

let ctx = fixture::setup(&test_info, &stores, &chain, None, None).await;
let _ = ctx
.runner(stop_block)
.await
.run_for_test(true)
.await
.unwrap();
}

#[tokio::test]
async fn retry_create_ds() {
let RunnerTestRecipe { stores, test_info } =
Expand Down

0 comments on commit 743a451

Please sign in to comment.