gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: harness: run new merchant hel


From: gnunet
Subject: [taler-wallet-core] branch master updated: harness: run new merchant helper processes in tests
Date: Mon, 09 Sep 2024 16:41:17 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 0174bcb85 harness: run new merchant helper processes in tests
0174bcb85 is described below

commit 0174bcb85541546671cf703b528d3270baaa586b
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Sep 9 16:41:11 2024 +0200

    harness: run new merchant helper processes in tests
---
 packages/taler-harness/src/harness/harness.ts | 58 +++++++++++++++++++++++----
 1 file changed, 50 insertions(+), 8 deletions(-)

diff --git a/packages/taler-harness/src/harness/harness.ts 
b/packages/taler-harness/src/harness/harness.ts
index 6a9188d13..659575700 100644
--- a/packages/taler-harness/src/harness/harness.ts
+++ b/packages/taler-harness/src/harness/harness.ts
@@ -1678,7 +1678,9 @@ export class MerchantService implements 
MerchantServiceInterface {
     return new MerchantService(gc, mc, cfgFilename);
   }
 
-  proc: ProcessWrapper | undefined;
+  procHttpd: ProcessWrapper | undefined;
+  procExchangekeyupdate: ProcessWrapper | undefined;
+  procKyccheck: ProcessWrapper | undefined;
 
   constructor(
     private globalState: GlobalTestState,
@@ -1689,7 +1691,7 @@ export class MerchantService implements 
MerchantServiceInterface {
   private currentTimetravelOffsetMs: number | undefined;
 
   private isRunning(): boolean {
-    return !!this.proc;
+    return !!this.procHttpd;
   }
 
   setTimetravel(t: number | undefined): void {
@@ -1729,11 +1731,23 @@ export class MerchantService implements 
MerchantServiceInterface {
   }
 
   async stop(): Promise<void> {
-    const httpd = this.proc;
+    const httpd = this.procHttpd;
     if (httpd) {
       httpd.proc.kill("SIGTERM");
       await httpd.wait();
-      this.proc = undefined;
+      this.procHttpd = undefined;
+    }
+    const exchangekeyupdate = this.procExchangekeyupdate;
+    if (exchangekeyupdate) {
+      exchangekeyupdate.proc.kill("SIGTERM");
+      await exchangekeyupdate.wait();
+      this.procExchangekeyupdate = undefined;
+    }
+    const kyccheck = this.procKyccheck;
+    if (kyccheck) {
+      kyccheck.proc.kill("SIGTERM");
+      await kyccheck.wait();
+      this.procKyccheck = undefined;
     }
   }
 
@@ -1756,7 +1770,7 @@ export class MerchantService implements 
MerchantServiceInterface {
       await this.dbinit();
     }
 
-    this.proc = this.globalState.spawnService(
+    this.procHttpd = this.globalState.spawnService(
       "taler-merchant-httpd",
       [
         "taler-merchant-httpd",
@@ -1765,7 +1779,31 @@ export class MerchantService implements 
MerchantServiceInterface {
         this.configFilename,
         ...this.timetravelArgArr,
       ],
-      `merchant-${this.merchantConfig.name}`,
+      `merchant-httpd-${this.merchantConfig.name}`,
+    );
+
+    this.procExchangekeyupdate = this.globalState.spawnService(
+      "taler-merchant-exchangekeyupdate",
+      [
+        "taler-merchant-exchangekeyupdate",
+        "-LDEBUG",
+        "-c",
+        this.configFilename,
+        ...this.timetravelArgArr,
+      ],
+      `merchant-exchangekeyupdate-${this.merchantConfig.name}`,
+    );
+
+    this.procKyccheck = this.globalState.spawnService(
+      "taler-merchant-kyccheck",
+      [
+        "taler-merchant-kyccheck",
+        "-LDEBUG",
+        "-c",
+        this.configFilename,
+        ...this.timetravelArgArr,
+      ],
+      `merchant-kyccheck-${this.merchantConfig.name}`,
     );
 
     await this.pingUntilAvailable();
@@ -1836,7 +1874,7 @@ export class MerchantService implements 
MerchantServiceInterface {
   async addInstanceWithWireAccount(
     instanceConfig: PartialMerchantInstanceConfig,
   ): Promise<void> {
-    if (!this.proc) {
+    if (!this.procHttpd) {
       throw Error("merchant must be running to add instance");
     }
     logger.info(`adding instance '${instanceConfig.id}'`);
@@ -1888,7 +1926,11 @@ export class MerchantService implements 
MerchantServiceInterface {
 
   async pingUntilAvailable(): Promise<void> {
     const url = `http://localhost:${this.merchantConfig.httpPort}/config`;
-    await pingProc(this.proc, url, `merchant (${this.merchantConfig.name})`);
+    await pingProc(
+      this.procHttpd,
+      url,
+      `merchant (${this.merchantConfig.name})`,
+    );
   }
 }
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]