Skip to content

Commit 5fc15f6

Browse files
committed
ci: run dag connection test
1 parent 9de24ac commit 5fc15f6

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
strategy:
3434
matrix:
3535
# test: [scenarios_test.py, rpc_test.py, graph_test.py, ln_test.py, dag_connection_test.py, logging_test.py]
36-
test: [graph_test.py, rpc_test.py, scenarios_test.py, graph_test.py]
36+
test: [scenarios_test.py, rpc_test.py, graph_test.py, dag_connection_test.py, logging_test.py]
3737
steps:
3838
- uses: actions/checkout@v4
3939
- uses: hynek/setup-cached-uv@v1

test/dag_connection_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def __init__(self):
1414
)
1515

1616
def run_test(self):
17-
self.start_server()
1817
try:
1918
self.setup_network()
2019
self.run_connect_dag_scenario()

test/data/scenario_connect_dag.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
from enum import Enum, auto, unique
55
from time import sleep
66

7-
from warnet.test_framework_bridge import WarnetTestFramework
7+
# The base class exists inside the commander container
8+
from commander import Commander
89

910

1011
def cli_help():
@@ -17,7 +18,7 @@ class ConnectionType(Enum):
1718
DNS = auto()
1819

1920

20-
class ConnectDag(WarnetTestFramework):
21+
class ConnectDag(Commander):
2122
def set_test_params(self):
2223
# This is just a minimum
2324
self.num_nodes = 10

test/test_base.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from warnet import SRC_DIR
1414
from warnet.cli.network import _status as network_status
1515
from warnet.cli.network import _connected as network_connected
16-
16+
from warnet.cli.scenarios import _active as scenarios_active
1717

1818
class TestBase:
1919
def __init__(self):
@@ -128,9 +128,13 @@ def wait_for_all_edges(self, timeout=20 * 60, interval=5):
128128

129129
def wait_for_all_scenarios(self):
130130
def check_scenarios():
131-
scns = self.rpc("scenarios_list_running")
132-
return all(not scn["active"] for scn in scns)
133-
131+
scns = scenarios_active()
132+
if len(scns) == 0:
133+
return True
134+
for s in scns:
135+
if s["status"] != "succeeded":
136+
return False
137+
return True
134138
self.wait_for_predicate(check_scenarios)
135139

136140
def get_scenario_return_code(self, scenario_name):

0 commit comments

Comments
 (0)