testing: Prepare light client testing with substrate binary and add subxt-test macro (#1507)

* testing: Add long running light client flag and cfg aliases

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Expose clients depending on feature flags

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Use unstable backend for light client

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Disable flaky lightclient tests

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* ci: Add long runnnig step

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Revert "subxt: Use unstable backend for light client"

This reverts commit ea6f3cc58b.

* ci: Long running tests for 60 mins

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* ci: Use 16 cores for light-client testing

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* ci: Isolate light-client testing to save CI minutes

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Retry on Tx::Dropped for lightclinet only

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Wait for more blocks for the lightclient init

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Use unstable backend for light client

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Disable legacy RPC tests

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Disable sudo and contracts tests

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Retry constructing lightclient on read-proof errors

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Disable tx dynamic test

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* proc-macro: Timeout for tests

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Add timeout 800 seconds

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* proc-macro/tests: Adjust subxt-test proc-macro

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* proc-macro: Rename crate to subxt-test-proc-macro

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Use default subxt-proc-macro timeout

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* light-client: Remove println

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Remove tokio as dependency, use it only for testing

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Chagne default timeout to 6 seconds

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* proc-macro: Add env timeout variable

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* ci: Add subxt env var for controling test timeouts

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* tests/tx-retries: Retry on `Non node available` error

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Use unstable backend for testing lightclient

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Remove old lightclient object

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* testing: Adjust for the new interface

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* backend/rpc: Allow older version of the initialized event

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rpc/tests: Check initialized decodes correctly

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* ci: Reset workflow

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Apply cargo fmt

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Remove unused dep

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Remove gitmerge old file

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Remove unused dep

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* rename proc-macro to subxt-test-macro

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* tests: Remove txretries for lightclient

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* tests: Wait for 5 blocks for the lightclient full testing suite

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* tests: Group imports

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* macro: Rename const value

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2024-04-08 11:34:20 +03:00
committed by GitHub
parent 827a35de34
commit b31131d21d
26 changed files with 555 additions and 182 deletions
@@ -5,9 +5,9 @@
//! Just sanity checking some of the legacy RPC methods to make
//! sure they don't error out and can decode their results OK.
use crate::test_context;
use crate::{subxt_test, test_context};
#[tokio::test]
#[subxt_test]
async fn chain_get_block_hash() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -15,7 +15,7 @@ async fn chain_get_block_hash() {
rpc.chain_get_block_hash(None).await.unwrap();
}
#[tokio::test]
#[subxt_test]
async fn chain_get_block() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -24,7 +24,7 @@ async fn chain_get_block() {
rpc.chain_get_block(hash).await.unwrap();
}
#[tokio::test]
#[subxt_test]
async fn chain_get_finalized_head() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -32,7 +32,7 @@ async fn chain_get_finalized_head() {
rpc.chain_get_finalized_head().await.unwrap();
}
#[tokio::test]
#[subxt_test]
async fn chain_subscribe_all_heads() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -41,7 +41,7 @@ async fn chain_subscribe_all_heads() {
let _block_header = sub.next().await.unwrap().unwrap();
}
#[tokio::test]
#[subxt_test]
async fn chain_subscribe_finalized_heads() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -50,7 +50,7 @@ async fn chain_subscribe_finalized_heads() {
let _block_header = sub.next().await.unwrap().unwrap();
}
#[tokio::test]
#[subxt_test]
async fn chain_subscribe_new_heads() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -59,7 +59,7 @@ async fn chain_subscribe_new_heads() {
let _block_header = sub.next().await.unwrap().unwrap();
}
#[tokio::test]
#[subxt_test]
async fn genesis_hash() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -67,7 +67,7 @@ async fn genesis_hash() {
let _genesis_hash = rpc.genesis_hash().await.unwrap();
}
#[tokio::test]
#[subxt_test]
async fn state_get_metadata() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -75,7 +75,7 @@ async fn state_get_metadata() {
let _metadata = rpc.state_get_metadata(None).await.unwrap();
}
#[tokio::test]
#[subxt_test]
async fn state_call() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -86,7 +86,7 @@ async fn state_call() {
.unwrap();
}
#[tokio::test]
#[subxt_test]
async fn system_health() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -94,7 +94,7 @@ async fn system_health() {
let _ = rpc.system_health().await.unwrap();
}
#[tokio::test]
#[subxt_test]
async fn system_chain() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -102,7 +102,7 @@ async fn system_chain() {
let _ = rpc.system_chain().await.unwrap();
}
#[tokio::test]
#[subxt_test]
async fn system_name() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -110,7 +110,7 @@ async fn system_name() {
let _ = rpc.system_name().await.unwrap();
}
#[tokio::test]
#[subxt_test]
async fn system_version() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;
@@ -118,7 +118,7 @@ async fn system_version() {
let _ = rpc.system_version().await.unwrap();
}
#[tokio::test]
#[subxt_test]
async fn system_properties() {
let ctx = test_context().await;
let rpc = ctx.legacy_rpc_methods().await;