mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 14:31:13 +00:00
Put integration tests behind feature flag (#515)
* subxt: Add integration-tests feature flag Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Guard integration tests under feature flag Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * test-runtime: Place build.rs under feature flag Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Pass `integration-tests` feature to `test-runtime` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * CI: Use `integration-tests` feature to run all tests Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Rely on `#[cfg(feature = "integration-tests")]` for integration Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/metadata: Manually construct test metadata Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * artifacts: Move scale binary blob to dedicated folder Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Update path to metadata blob Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Rely on artifact metadata blob for benches Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * metadata: Remove `test-runtime` dependency Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * examples: Modify runtime path for `custom_type_derives` Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Remove tests folder Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * test-runtime: Remove `integration-tests` feature flag Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * integration-tests: Add an integration test crate for subxt Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Remove `test-runtime` dependency Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Add comment for feature flags Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * integration-tests: Trim dependencies Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * integration-tests: Move dependencies under dev Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Revert "CI: Use `integration-tests` feature to run all tests" This reverts commit 8e5f38ba8c633ac40420fadf58700ac402f762d4. * integration-tests: Remove integration folder Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Fix feature flag and test comment Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Extra feature flag comment Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * integration-tests: Move tests content under src Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -21,7 +21,6 @@ sp-core = { version = "6.0.0" }
|
||||
bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
|
||||
criterion = "0.3"
|
||||
scale-info = { version = "2.0.0", features = ["bit-vec"] }
|
||||
test-runtime = { path = "../test-runtime" }
|
||||
|
||||
[lib]
|
||||
# Without this, libtest cli opts interfere with criteron benches:
|
||||
|
||||
@@ -26,6 +26,10 @@ use scale_info::{
|
||||
TypeDef,
|
||||
TypeDefVariant,
|
||||
};
|
||||
use std::{
|
||||
fs,
|
||||
path::Path,
|
||||
};
|
||||
use subxt_metadata::{
|
||||
get_call_hash,
|
||||
get_constant_hash,
|
||||
@@ -35,7 +39,8 @@ use subxt_metadata::{
|
||||
};
|
||||
|
||||
fn load_metadata() -> RuntimeMetadataV14 {
|
||||
let bytes = test_runtime::METADATA;
|
||||
let bytes = fs::read(Path::new("../artifacts/polkadot_metadata.scale"))
|
||||
.expect("Cannot read metadata blob");
|
||||
let meta: RuntimeMetadataPrefixed =
|
||||
Decode::decode(&mut &*bytes).expect("Cannot decode scale metadata");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user