commit 0c19050ae76d85fa7da43ef5239dc1d6f0bb6a4d
parent a1c5f00aedb75e5e2deb6b12c3cfb06eefb355e4
Author: Florian Dold <florian@dold.me>
Date: Wed, 7 Dec 2022 15:36:56 +0100
wallet: add 'env-full' test environment with merchant
Diffstat:
2 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts
@@ -68,6 +68,7 @@ import { runEnv1 } from "./env1.js";
import { GlobalTestState, runTestWithState } from "./harness/harness.js";
import { getTestInfo, runTests } from "./integrationtests/testrunner.js";
import { lintExchangeDeployment } from "./lint.js";
+import { runEnvFull } from "./env-full.js";
// @ts-ignore
global.TextEncoder = TextEncoder;
// @ts-ignore
@@ -910,6 +911,18 @@ advancedCli
});
advancedCli
+ .subcommand("envFull", "env-full", {
+ help: "Run a test environment for bench1",
+ })
+ .action(async (args) => {
+ const testDir = fs.mkdtempSync(path.join(os.tmpdir(), "taler-env-full-"));
+ const testState = new GlobalTestState({
+ testDir,
+ });
+ await runTestWithState(testState, runEnvFull, "env-full", true);
+ });
+
+advancedCli
.subcommand("env1", "env1", {
help: "Run a test environment for bench1",
})
diff --git a/packages/taler-wallet-embedded/src/wallet-qjs.ts b/packages/taler-wallet-embedded/src/wallet-qjs.ts
@@ -422,5 +422,23 @@ export async function testWithGv() {
});
}
+export async function testWithLocal() {
+ const w = await getWallet();
+ await w.wallet.client.call(WalletApiOperation.InitWallet, {});
+ await w.wallet.client.call(WalletApiOperation.RunIntegrationTest, {
+ amountToSpend: "TESTKUDOS:1",
+ amountToWithdraw: "TESTKUDOS:3",
+ bankBaseUrl: "http://localhost:8082/",
+ bankAccessApiBaseUrl: "http://localhost:8082/taler-bank-access/",
+ exchangeBaseUrl: "http://localhost:8081/",
+ merchantBaseUrl: "http://backend.demo.taler.net:8083/",
+ });
+ await w.wallet.runTaskLoop({
+ stopWhenDone: true,
+ });
+}
+
// @ts-ignore
globalThis.testWithGv = testWithGv;
+// @ts-ignore
+globalThis.testWithLocal = testWithLocal;