testing: give option to restart merchant without DB reset.

This commit is contained in:
ms 2021-07-30 09:46:19 +02:00
parent acf041d144
commit 2ccfa3c2f2
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F
3 changed files with 8 additions and 7 deletions

View File

@ -1441,8 +1441,10 @@ export class MerchantService implements MerchantServiceInterface {
}
}
async start(): Promise<void> {
await exec(`taler-merchant-dbinit -r -c "${this.configFilename}"`);
async start(
withResetTables: boolean = true, // eventually, this should become a named parameter
): Promise<void> {
await exec(`taler-merchant-dbinit ${withResetTables ? "-r" : ""} -c "${this.configFilename}"`);
this.proc = this.globalState.spawnService(
"taler-merchant-httpd",

View File

@ -53,7 +53,7 @@ async function revokeAllWalletCoins(req: {
await exchange.keyup();
await delayMs(1000);
await merchant.stop();
await merchant.start();
await merchant.start(false); // 'false' prevents DB reset
await merchant.pingUntilAvailable();
}

View File

@ -63,10 +63,9 @@ export async function runTippingTest(t: GlobalTestState) {
await exchange.runWirewatchOnce();
// FIXME/WHY? Disabling for now, as start() erases the DB.
/*await merchant.stop();
await merchant.start();
await merchant.pingUntilAvailable();*/
await merchant.stop();
await merchant.start(false);
await merchant.pingUntilAvailable();
const r = await MerchantPrivateApi.queryTippingReserves(merchant, "default");
console.log("tipping reserves:", JSON.stringify(r, undefined, 2));