Skip to content

Commit b7067b9

Browse files
authored
Merge pull request #766 from openmina/ci/webrtc_tests/enable
Ci: enable webrtc tests
2 parents 2bb25c0 + 1993cf0 commit b7067b9

File tree

5 files changed

+40
-20
lines changed

5 files changed

+40
-20
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ jobs:
167167

168168
build-tests-webrtc:
169169
runs-on: ubuntu-20.04
170-
if: false
171170
steps:
172171
- name: Git checkout
173172
uses: actions/checkout@v4
@@ -199,11 +198,11 @@ jobs:
199198
- name: Upload tests
200199
uses: actions/upload-artifact@v4
201200
with:
202-
name: tests-webrct
201+
name: tests-webrtc
203202
path: target/release/tests
204203

205204
p2p-scenario-tests:
206-
needs: [ build-tests ]
205+
needs: [ build-tests, build-tests-webrtc ]
207206
runs-on: ubuntu-20.04
208207
container:
209208
image: minaprotocol/mina-daemon:3.0.0-dc6bf78-focal-devnet
@@ -212,7 +211,8 @@ jobs:
212211
BPF_ALIAS: /coda/0.0.1/29936104443aaf264a7f0192ac64b1c7173198c1ed404c1bcff5e562e05eb7f6-0.0.0.0
213212
strategy:
214213
matrix:
215-
test: [p2p_basic_connections, p2p_basic_incoming, p2p_basic_outgoing, p2p_pubsub, p2p_kad]
214+
test: [p2p_basic_connections, p2p_basic_incoming, p2p_basic_outgoing, p2p_pubsub, p2p_kad,
215+
webrtc_p2p_basic_connections]
216216
fail-fast: false
217217

218218
services:
@@ -231,7 +231,8 @@ jobs:
231231
- name: Download tests
232232
uses: actions/download-artifact@v4
233233
with:
234-
name: tests
234+
pattern: tests*
235+
merge-multiple: true
235236

236237
- name: Setup permissions
237238
run: |
@@ -355,7 +356,7 @@ jobs:
355356
needs:
356357
- k8s-peers
357358
- build-tests
358-
# - build-tests-webrtc
359+
- build-tests-webrtc
359360
runs-on: ubuntu-20.04
360361
container:
361362
image: minaprotocol/mina-daemon:3.0.0-dc6bf78-focal-devnet
@@ -365,7 +366,7 @@ jobs:
365366
OPENMINA_SCENARIO_SEEDS: ${{ needs.k8s-peers.outputs.peers }}
366367
strategy:
367368
matrix:
368-
test: [record_replay]
369+
test: [record_replay, webrtc_record_replay]
369370
fail-fast: false
370371

371372
steps:

node/testing/tests/common.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ macro_rules! scenario_doc {
1010

1111
#[macro_export]
1212
macro_rules! scenario_test {
13-
1413
($(#[$meta:meta])? $name:ident, $scenario:ty, $scenario_instance:expr) => {
14+
scenario_test!($(#[$meta])? $name, $scenario, $scenario_instance, false);
15+
};
16+
($(#[$meta:meta])? $name:ident, $scenario:ty, $scenario_instance:expr, $can_test_webrtc:expr) => {
1517
#[tokio::test]
1618
$(#[$meta])?
1719
async fn $name() {
@@ -55,7 +57,13 @@ macro_rules! scenario_test {
5557
}));
5658
}
5759

58-
let config = ClusterConfig::new(None).unwrap();
60+
#[allow(unused_mut)]
61+
let mut config = ClusterConfig::new(None).unwrap();
62+
#[cfg(feature = "p2p-webrtc")]
63+
if $can_test_webrtc {
64+
eprintln!("All rust to rust connections will be over webrtc transport");
65+
config = config.set_all_rust_to_rust_use_webrtc();
66+
}
5967
let mut cluster = Cluster::new(config);
6068
let runner = ClusterRunner::new(&mut cluster, |_| {});
6169
let scenario = $scenario_instance;

node/testing/tests/p2p_basic_incoming.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ mod common;
77
scenario_test!(
88
accept_connection,
99
AcceptIncomingConnection,
10-
AcceptIncomingConnection
10+
AcceptIncomingConnection,
11+
true
1112
);
1213
scenario_test!(
1314
accept_multiple_connections,
1415
AcceptMultipleIncomingConnections,
15-
AcceptMultipleIncomingConnections
16+
AcceptMultipleIncomingConnections,
17+
true
1618
);

node/testing/tests/p2p_basic_outgoing.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,27 @@ mod common;
99
scenario_test!(
1010
make_connection,
1111
MakeOutgoingConnection,
12-
MakeOutgoingConnection
12+
MakeOutgoingConnection,
13+
true
1314
);
1415
scenario_test!(
1516
make_multiple_connections,
1617
MakeMultipleOutgoingConnections,
17-
MakeMultipleOutgoingConnections
18+
MakeMultipleOutgoingConnections,
19+
true
1820
);
1921

2022
scenario_test!(
2123
dont_connect_to_node_same_id,
2224
DontConnectToNodeWithSameId,
23-
DontConnectToNodeWithSameId
25+
DontConnectToNodeWithSameId,
26+
true
2427
);
2528
scenario_test!(
2629
dont_connect_to_initial_peer_same_id,
2730
DontConnectToInitialPeerWithSameId,
28-
DontConnectToInitialPeerWithSameId
31+
DontConnectToInitialPeerWithSameId,
32+
true
2933
);
3034
scenario_test!(
3135
dont_connect_to_self_initial_peer,
@@ -36,15 +40,18 @@ scenario_test!(
3640
scenario_test!(
3741
connect_to_all_initial_peers,
3842
ConnectToInitialPeers,
39-
ConnectToInitialPeers
43+
ConnectToInitialPeers,
44+
true
4045
);
4146
scenario_test!(
4247
connect_to_offline_initial_peers,
4348
ConnectToUnavailableInitialPeers,
44-
ConnectToUnavailableInitialPeers
49+
ConnectToUnavailableInitialPeers,
50+
true
4551
);
4652
scenario_test!(
4753
connect_to_all_initial_peers_become_ready,
4854
ConnectToInitialPeersBecomeReady,
49-
ConnectToInitialPeersBecomeReady
55+
ConnectToInitialPeersBecomeReady,
56+
true
5057
);

node/testing/tests/record_replay.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ mod common;
77
scenario_test!(
88
record_replay_bootstrap,
99
RecordReplayBootstrap,
10-
RecordReplayBootstrap
10+
RecordReplayBootstrap,
11+
true
1112
);
1213

1314
scenario_test!(
1415
record_replay_block_production,
1516
RecordReplayBlockProduction,
16-
RecordReplayBlockProduction
17+
RecordReplayBlockProduction,
18+
true
1719
);

0 commit comments

Comments
 (0)