Skip to content

Commit 2b51bb9

Browse files
committed
test: migrate integration tests from metrics to database checker
- Replace MetricsChecker with DatabaseChecker for more reliable state verification - Add comprehensive V1 TAP test implementation with database validation - Enable early exit on successful RAV creation in V2 tests - Add detailed progress tracking with trigger threshold calculations - Implement delayed RAV creation detection with timeout handling - Remove commented-out legacy metrics code and unused imports - Disable invalid_chain_id test temporarily - Consolidate import statements across test modules The database checker provides direct access to TAP state rather than relying on metrics parsing, which are less reliable.
1 parent f170d16 commit 2b51bb9

File tree

8 files changed

+180
-102
lines changed

8 files changed

+180
-102
lines changed

integration-tests/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ sqlx = { workspace = true, features = [
4242
] }
4343
# rdkafka = { workspace = true }
4444
rdkafka = { version = "0.38.0", features = ["gssapi", "tracing"] }
45+
regex = "1"

integration-tests/src/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ pub const GATEWAY_API_KEY: &str = "deadbeefdeadbeefdeadbeefdeadbeef";
1111
pub const GATEWAY_URL: &str = "http://localhost:7700";
1212
pub const TAP_AGENT_METRICS_URL: &str = "http://localhost:7300/metrics";
1313

14+
// pub const MNEMONIC: &str = "test test test test test test test test test test test junk";
1415
// Wallet
1516
// - Account 0 used by: EBO, admin actions (deploy contracts, transfer ETH/GRT), gateway sender for PaymentsEscrow
1617
// - Account 1 used by: Gateway signer for PaymentsEscrow
17-
pub const MNEMONIC: &str = "test test test test test test test test test test test junk";
1818
pub const ACCOUNT0_ADDRESS: &str = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";
1919
pub const ACCOUNT0_SECRET: &str =
2020
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";

integration-tests/src/database_checker.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// Copyright 2025-, Edge & Node, GraphOps, and Semiotic Labs.
22
// SPDX-License-Identifier: Apache-2.0
33

4+
use std::str::FromStr;
5+
46
use anyhow::Result;
57
use bigdecimal::BigDecimal;
68
use sqlx::{PgPool, Row};
7-
use std::str::FromStr;
89

910
/// Unified database checker for both V1 and V2 TAP tables
1011
pub struct DatabaseChecker {

integration-tests/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mod utils;
1919
use anyhow::Result;
2020
use clap::Parser;
2121
use load_test::{receipt_handler_load_test, receipt_handler_load_test_v2};
22-
pub(crate) use rav_tests::{test_tap_rav_v1, test_tap_rav_v2};
22+
pub(crate) use rav_tests::{test_invalid_chain_id, test_tap_rav_v1, test_tap_rav_v2};
2323

2424
/// Main CLI parser structure
2525
#[derive(Parser, Debug)]
@@ -61,7 +61,7 @@ async fn main() -> Result<()> {
6161

6262
match cli.command {
6363
Commands::Rav1 => {
64-
// test_invalid_chain_id().await?;
64+
test_invalid_chain_id().await?;
6565
test_tap_rav_v1().await?;
6666
}
6767
// cargo run -- rav2

0 commit comments

Comments
 (0)