Skip to content

Commit 83989d6

Browse files
committed
use rpc test url from env
1 parent 7299960 commit 83989d6

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
toolchain: 1.88.0
2020
- uses: Swatinem/rust-cache@v2
2121
- name: Run initial test to setup PG
22-
run: cargo test -p shared --features test
22+
run: cargo test -p shared --features test -- --nocapture
23+
env:
24+
RPC_URL: ${{ secrets.RPC_URL }}
2325
- name: Install pgrx system dependencies
2426
run: >
2527
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' &&
@@ -35,4 +37,6 @@ jobs:
3537
cd pg_golden_axe &&
3638
cargo pgrx install -p pg_golden_axe --pg-config /tmp/golden-axe-pg-test/install/postgresql-17.2.0-x86_64-unknown-linux-gnu/bin/pg_config
3739
- name: Run tests
38-
run: cargo test
40+
run: cargo test -- --no-capture
41+
env:
42+
RPC_URL: ${{ secrets.RPC_URL }}

shared/src/jrpc.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ mod tests {
277277

278278
#[test_log::test(tokio::test)]
279279
async fn test_block_and_logs() {
280-
let client = super::Client::new("https://eth.merkle.io/");
280+
let url = std::env::var("RPC_URL").unwrap_or_else(|_| "https://eth.merkle.io/".to_string());
281+
let client = super::Client::new(&url);
282+
println!("{url}");
281283
let n: u64 = 12_911_679;
282284

283285
let b = client.block(format!("0x{:x}", n)).await.unwrap();

0 commit comments

Comments
 (0)