From 0193c09061b568017f56ce64dd67ba16b971bce7 Mon Sep 17 00:00:00 2001 From: jbesraa Date: Wed, 4 Sep 2024 13:13:42 +0300 Subject: [PATCH] Make TP test module port configurable This enables running multiple TP's across different tests simultaneously. --- roles/tests-integration/tests/common/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/roles/tests-integration/tests/common/mod.rs b/roles/tests-integration/tests/common/mod.rs index 56e12f2006..0e41892571 100644 --- a/roles/tests-integration/tests/common/mod.rs +++ b/roles/tests-integration/tests/common/mod.rs @@ -65,14 +65,16 @@ pub struct TemplateProvider { } impl TemplateProvider { - pub fn start() -> Self { - let temp_dir = PathBuf::from("/tmp/.template-provider/"); + pub fn start(port: u16) -> Self { + let path_name = format!("/tmp/.template-provider-{}", port); + let temp_dir = PathBuf::from(&path_name); let mut conf = Conf::default(); + let port = format!("-sv2port={}", port); conf.args.extend(vec![ "-txindex=1", "-sv2", - "-sv2port=8442", + &port, "-debug=sv2", "-sv2interval=20", "-sv2feedelta=1000",