Skip to content

Commit e16e26b

Browse files
committed
test(p2p): doc and ci for in/out connections
1 parent 4acd7cd commit e16e26b

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,30 @@ jobs:
6767
name: tests
6868
path: tests.tar
6969

70+
p2p-tests:
71+
needs: [ build ]
72+
runs-on: ubuntu-20.04
73+
container:
74+
image: minaprotocol/mina-daemon:2.0.0rampup4-14047c5-focal-berkeley
75+
strategy:
76+
matrix:
77+
test: [p2p_basic_incoming, p2p_basic_outgoing]
78+
fail-fast: false
79+
80+
steps:
81+
- name: Download tests
82+
uses: actions/download-artifact@v3
83+
with:
84+
name: tests
85+
86+
- name: Unpack tests
87+
run: |
88+
tar xf tests.tar ./${{ matrix.test }}
89+
90+
- name: Run the test
91+
run: |
92+
./${{ matrix.test }} --nocapture --test-threads=1
93+
7094
scenario-tests:
7195
needs: [ build ]
7296
runs-on: ubuntu-20.04

node/testing/tests/p2p_basic_incoming.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use openmina_node_testing::scenarios::p2p::basic_incoming_connections::{
55
mod common;
66

77
scenario_test!(
8-
accept_incoming_connection,
8+
accept_connection,
99
AcceptIncomingConnection,
1010
AcceptIncomingConnection
1111
);
1212
scenario_test!(
13-
accept_multiple_incoming_connections,
13+
accept_multiple_connections,
1414
AcceptMultipleIncomingConnections,
1515
AcceptMultipleIncomingConnections
1616
);

node/testing/tests/p2p_basic_outgoing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use openmina_node_testing::scenarios::p2p::basic_outgoing_connections::{
55
mod common;
66

77
scenario_test!(
8-
make_outgoing_connection,
8+
make_connection,
99
MakeOutgoingConnection,
1010
MakeOutgoingConnection
1111
);
1212
scenario_test!(
13-
make_multiple_outgoing_connections,
13+
make_multiple_connections,
1414
MakeMultipleOutgoingConnections,
1515
MakeMultipleOutgoingConnections
1616
);

p2p/testing.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ should be present in the state machine.
1616
We should accept an incoming connection from an arbitrary node.
1717

1818
**Tests:**
19+
- [p2p_basic_incoming(accept_connection)](../node/testing/src/scenarios/p2p/basic_incoming_connections.rs#L16)
20+
- [p2p_basic_incoming(accept_multiple_connections)](../node/testing/src/scenarios/p2p/basic_incoming_connections.rs#L62)
1921
- [solo_node_accept_incoming](../node/testing/src/scenarios/solo_node/basic_connectivity_accept_incoming.rs)
2022
- [multi_node_connection_discovery/OCamlToRust](../node/testing/src/scenarios/multi_node/connection_discovery.rs#L127) (should be replaced with one with non-OCaml peer)
2123
- TODO: fast-running short test
@@ -43,6 +45,11 @@ malicious node that uses the same peer ID.
4345

4446
## Outgoing connections
4547

48+
### Node should connect to other nodes
49+
50+
- [`p2p_basic_outgoing(make_connection)`](../node/testing/src/scenarios/p2p/basic_outgoing_connections.rs#L19)
51+
- [`p2p_basic_outgoing(make_multiple_connections)`](../node/testing/src/scenarios/p2p/basic_outgoing_connections.rs#L74)
52+
4653
### Node should connect to all available initial peers
4754

4855
TODO: what if the number of initial peers exceeds the max number of peers?

0 commit comments

Comments
 (0)