Skip to content

Commit 5ee0c8b

Browse files
committed
clean up rebase on main, lint
1 parent 371fc20 commit 5ee0c8b

File tree

8 files changed

+18
-5
lines changed

8 files changed

+18
-5
lines changed

Diff for: resources/scenarios/ln_init.py

+1
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,6 @@ def funded_lnnodes():
184184
def main():
185185
LNInit().main()
186186

187+
187188
if __name__ == "__main__":
188189
main()

Diff for: resources/scenarios/miner_std.py

+1
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,6 @@ def run_test(self):
7171
def main():
7272
MinerStd().main()
7373

74+
7475
if __name__ == "__main__":
7576
main()

Diff for: resources/scenarios/reconnaissance.py

+1
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,6 @@ def run_test(self):
8383
def main():
8484
Reconnaissance().main()
8585

86+
8687
if __name__ == "__main__":
8788
main()

Diff for: resources/scenarios/test_scenarios/buggy_failure.py

+1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ def run_test(self):
2323
def main():
2424
Failure().main()
2525

26+
2627
if __name__ == "__main__":
2728
main()

Diff for: resources/scenarios/test_scenarios/connect_dag.py

+1
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,6 @@ def assert_connection(self, connector, connectee_index, connection_type: Connect
120120
def main():
121121
ConnectDag().main()
122122

123+
123124
if __name__ == "__main__":
124125
main()

Diff for: resources/scenarios/test_scenarios/p2p_interface.py

+1
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@ def run_test(self):
5555
def main():
5656
GetdataTest().main()
5757

58+
5859
if __name__ == "__main__":
5960
main()

Diff for: src/warnet/control.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
get_pods,
2525
pod_log,
2626
snapshot_bitcoin_datadir,
27-
wait_for_pod,
2827
wait_for_init,
28+
wait_for_pod,
2929
write_file_to_container,
3030
)
3131
from .process import run_command, stream_command
@@ -172,9 +172,11 @@ def get_active_network(namespace):
172172
default=False,
173173
help="Stream scenario output and delete container when stopped",
174174
)
175-
@click.option("--source_dir", type=click.Path(exists=True, file_okay=False, dir_okay=True), required=False)
175+
@click.option(
176+
"--source_dir", type=click.Path(exists=True, file_okay=False, dir_okay=True), required=False
177+
)
176178
@click.argument("additional_args", nargs=-1, type=click.UNPROCESSED)
177-
def run(scenario_file: str, source_dir, additional_args: tuple[str]):
179+
def run(scenario_file: str, debug: bool, source_dir, additional_args: tuple[str]):
178180
"""
179181
Run a scenario from a file.
180182
Pass `-- --help` to get individual scenario help
@@ -213,7 +215,10 @@ def run(scenario_file: str, source_dir, additional_args: tuple[str]):
213215
def filter(path):
214216
if any(needle in str(path) for needle in [".pyc", ".csv", ".DS_Store"]):
215217
return False
216-
if any(needle in str(path) for needle in ["__init__.py", "commander.py", "test_framework", scenario_path.name]):
218+
if any(
219+
needle in str(path)
220+
for needle in ["__init__.py", "commander.py", "test_framework", scenario_path.name]
221+
):
217222
print(f"Including: {path}")
218223
return True
219224
return False
@@ -280,6 +285,8 @@ def filter(path):
280285
print(f"Successfully uploaded scenario data to commander: {scenario_name}")
281286

282287
if debug:
288+
print("Waiting for commander pod to start...")
289+
wait_for_pod(name)
283290
_logs(pod_name=name, follow=True)
284291
print("Deleting pod...")
285292
delete_pod(name)

Diff for: src/warnet/k8s.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def delete_namespace(namespace: str) -> bool:
118118

119119

120120
def delete_pod(pod_name: str) -> bool:
121-
command = f"kubectl delete pod {pod_name}"
121+
command = f"kubectl -n {get_default_namespace()} delete pod {pod_name}"
122122
return stream_command(command)
123123

124124

0 commit comments

Comments
 (0)