diff options
author | Iván Ávalos <avalos@disroot.org> | 2024-06-25 09:07:15 -0600 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-06-26 16:32:40 +0200 |
commit | 0b7caf3909fa13a0a5e789d5fadeb4d886615a67 (patch) | |
tree | 6577fc837740af5c0801a0c51b26bab19ce453d3 /packages/taler-harness/src | |
parent | a5a541a21638a06b7f6159bea75a978b6bf23f50 (diff) | |
download | wallet-core-0b7caf3909fa13a0a5e789d5fadeb4d886615a67.tar.xz |
enable observability without setting TALER_TEST_OBSERVABILITY
Diffstat (limited to 'packages/taler-harness/src')
-rw-r--r-- | packages/taler-harness/src/harness/helpers.ts | 14 | ||||
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-wallet-network-availability.ts | 8 |
2 files changed, 14 insertions, 8 deletions
diff --git a/packages/taler-harness/src/harness/helpers.ts b/packages/taler-harness/src/harness/helpers.ts index d194b0d36..2720be474 100644 --- a/packages/taler-harness/src/harness/helpers.ts +++ b/packages/taler-harness/src/harness/helpers.ts @@ -118,6 +118,8 @@ export interface EnvOptions { skipWireFeeCreation?: boolean; + walletTestObservability?: boolean; + additionalExchangeConfig?(e: ExchangeService): void; additionalMerchantConfig?(m: MerchantService): void; additionalBankConfig?(b: BankService): void; @@ -556,9 +558,12 @@ export async function createSimpleTestkudosEnvironmentV3( ), }); - const { walletClient, walletService } = await createWalletDaemonWithClient( - t, - { name: "wallet", persistent: true }, + const { walletClient, walletService } = await createWalletDaemonWithClient(t, + { + name: "wallet", + persistent: true, + emitObservabilityEvents: !!opts.walletTestObservability, + }, ); console.log("setup done!"); @@ -580,6 +585,7 @@ export interface CreateWalletArgs { persistent?: boolean; overrideDbPath?: string; config?: PartialWalletRunConfig; + emitObservabilityEvents?: boolean; } export async function createWalletDaemonWithClient( @@ -617,7 +623,7 @@ export async function createWalletDaemonWithClient( const defaultRunConfig = { testing: { skipDefaults: true, - emitObservabilityEvents: !!process.env["TALER_TEST_OBSERVABILITY"], + emitObservabilityEvents: !!process.env["TALER_TEST_OBSERVABILITY"] || !!args.emitObservabilityEvents, }, } satisfies PartialWalletRunConfig; await walletClient.client.call(WalletApiOperation.InitWallet, { diff --git a/packages/taler-harness/src/integrationtests/test-wallet-network-availability.ts b/packages/taler-harness/src/integrationtests/test-wallet-network-availability.ts index 4506c47ff..d97737e25 100644 --- a/packages/taler-harness/src/integrationtests/test-wallet-network-availability.ts +++ b/packages/taler-harness/src/integrationtests/test-wallet-network-availability.ts @@ -34,12 +34,12 @@ import { TaskRunResultType } from "../../../taler-wallet-core/src/common.js"; */ export async function runWalletNetworkAvailabilityTest(t: GlobalTestState) { - // We need this to listen to the network-required observability event - process.env['TALER_TEST_OBSERVABILITY'] = '1'; - // Set up test environment const { bankClient, walletClient, exchange } = - await createSimpleTestkudosEnvironmentV3(t); + await createSimpleTestkudosEnvironmentV3(t, undefined, { + // We need this to listen to the network-required observability event + walletTestObservability: true, + }); await withdrawViaBankV3(t, { walletClient, |