Skip to content

Commit 293adc1

Browse files
authored
Merge pull request #17 from lightningdevkit/self-hosted-runner
2 parents a7b0720 + 6d7ffb4 commit 293adc1

4 files changed

Lines changed: 285 additions & 260 deletions

File tree

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
rust_tests:
1212
name: Rust Checks
13-
runs-on: ubuntu-latest
13+
runs-on: self-hosted
1414
steps:
1515
- uses: actions/checkout@v4
1616
- uses: actions-rs/toolchain@v1
@@ -47,7 +47,7 @@ jobs:
4747
run: cargo check -p orange-cli
4848

4949
- name: Run tests
50-
run: cargo test --features _test-utils
50+
run: cargo test --features _test-utils -- --test-threads=2
5151

5252
- name: Run cashu tests
53-
run: cargo test --features _cashu-tests
53+
run: cargo test --features _cashu-tests -- --test-threads=2

orange-sdk/src/trusted_wallet/dummy.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl DummyTrustedWallet {
6464
cookie.password,
6565
);
6666

67-
let tmp = temp_dir().join(format!("orange-test-{uuid}-dummy-ldk"));
67+
let tmp = temp_dir().join(format!("orange-test-{uuid}/dummy-ldk"));
6868
builder.set_storage_dir_path(tmp.to_str().unwrap().to_string());
6969

7070
let port = get_available_port().unwrap();
@@ -199,7 +199,8 @@ impl DummyTrustedWallet {
199199
});
200200

201201
// wait for ldk to be ready
202-
for _ in 0..10 {
202+
let iterations = if std::env::var("CI").is_ok() { 120 } else { 10 };
203+
for _ in 0..iterations {
203204
if ldk_node.status().is_listening {
204205
break;
205206
}
@@ -210,13 +211,19 @@ impl DummyTrustedWallet {
210211
lsp.open_channel(ldk_node.node_id(), socket_addr, 1_000_000, Some(500_000_000), None)
211212
.unwrap();
212213
// wait for channel to be broadcast
213-
tokio::time::sleep(Duration::from_secs(1)).await;
214+
for _ in 0..iterations {
215+
let num_txs = bitcoind.client.get_mempool_info().unwrap().size;
216+
if num_txs > 0 {
217+
break;
218+
}
219+
tokio::time::sleep(Duration::from_millis(250)).await;
220+
}
214221
// confirm channel
215222
let addr = bitcoind.client.new_address().unwrap();
216223
bitcoind.client.generate_to_address(6, &addr).unwrap();
217224

218225
// wait for sync/channel ready
219-
for _ in 0..10 {
226+
for _ in 0..iterations {
220227
if ldk_node.list_channels().first().is_some_and(|c| c.is_usable) {
221228
break;
222229
}

0 commit comments

Comments
 (0)