taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit b2864507bbd4e27a7d74fdcdf801b8eb34dbe3c4
parent 727c0f3d4d92e6fe2e3d1bdf4cb2e00dca01bd52
Author: Florian Dold <florian@dold.me>
Date:   Thu,  7 Mar 2024 18:28:00 +0100

harness: do not modify original DB when doing migration checks

Diffstat:
Mpackages/taler-harness/src/index.ts | 16+++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/packages/taler-harness/src/index.ts b/packages/taler-harness/src/index.ts @@ -25,12 +25,9 @@ import { Duration, HttpStatusCode, Logger, - MerchantApiClient, MerchantInstanceConfig, RegisterAccountRequest, - TalerCorebankApiClient, TransactionsResponse, - addPaytoQueryParams, decodeCrock, generateIban, j2s, @@ -47,6 +44,10 @@ import { SynchronousCryptoWorkerFactoryPlain, WalletApiOperation, } from "@gnu-taler/taler-wallet-core"; +import { + downloadExchangeInfo, + topupReserveWithDemobank, +} from "@gnu-taler/taler-wallet-core/dbless"; import { deepStrictEqual } from "assert"; import fs from "fs"; import os from "os"; @@ -68,7 +69,6 @@ import { } from "./harness/helpers.js"; import { getTestInfo, runTests } from "./integrationtests/testrunner.js"; import { lintExchangeDeployment } from "./lint.js"; -import { downloadExchangeInfo, topupReserveWithDemobank } from "@gnu-taler/taler-wallet-core/dbless"; const logger = new Logger("taler-harness:index.ts"); @@ -227,13 +227,15 @@ advancedCli const t: GlobalTestState = new GlobalTestState({ testDir: testRootDir, }); - const walletDbPath = `${indir}/wallet-db.sqlite3`; - if (!fs.existsSync(walletDbPath)) { + const origWalletDbPath = `${indir}/wallet-db.sqlite3`; + const testWalletDbPath = `${testRootDir}/wallet-testdb.sqlite3`; + fs.cpSync(origWalletDbPath, testWalletDbPath); + if (!fs.existsSync(origWalletDbPath)) { throw new Error("wallet db to be checked does not exist"); } const { walletClient, walletService } = await createWalletDaemonWithClient( t, - { name: "wallet-loaded", overrideDbPath: walletDbPath }, + { name: "wallet-loaded", overrideDbPath: testWalletDbPath }, ); await walletService.pingUntilAvailable();