diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-08-07 11:33:48 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-08-07 11:36:30 +0530 |
commit | 32755f547547ddede4fd69951bdee0beda91c4f7 (patch) | |
tree | b8df188843d12b8f56fa4e987dd111cd23581bf8 | |
parent | e79a118ab6fb19eb981e2b1fa29e42455873b97d (diff) |
only shut down once
5 files changed, 13 insertions, 6 deletions
diff --git a/packages/taler-integrationtests/src/harness.ts b/packages/taler-integrationtests/src/harness.ts index ec25ca25b..3a652e291 100644 --- a/packages/taler-integrationtests/src/harness.ts +++ b/packages/taler-integrationtests/src/harness.ts @@ -220,6 +220,7 @@ export class GlobalTestState { testDir: string; procs: ProcessWrapper[]; servers: http.Server[]; + inShutdown: false; constructor(params: GlobalTestParams) { this.testDir = params.testDir; this.procs = []; @@ -307,8 +308,11 @@ export class GlobalTestState { return procWrap; } - async terminate(): Promise<void> { - console.log("terminating"); + async shutdown(): Promise<void> { + if (this.inShutdown) { + return; + } + console.log("shutting down"); for (const s of this.servers) { s.close(); s.removeAllListeners(); @@ -892,7 +896,7 @@ export function runTest(testMain: (gc: GlobalTestState) => Promise<void>) { console.log("test logs and config can be found under", gc.testDir); console.log("keeping test environment running"); } else { - await gc.terminate(); + await gc.shutdown(); console.log("test logs and config can be found under", gc.testDir); process.exit(ret); } diff --git a/packages/taler-integrationtests/src/merchantApiTypes.ts b/packages/taler-integrationtests/src/merchantApiTypes.ts index 412b9bb8b..fe70c356c 100644 --- a/packages/taler-integrationtests/src/merchantApiTypes.ts +++ b/packages/taler-integrationtests/src/merchantApiTypes.ts @@ -93,6 +93,7 @@ export const codecForCheckPaymentUnpaidResponse = (): codec.Codec< .makeCodecForObject<CheckPaymentUnpaidResponse>() .property("order_status", codec.makeCodecForConstString("unpaid")) .property("taler_pay_uri", codec.codecForString) + .property("order_status_url", codec.codecForString) .property( "already_paid_order_id", codec.makeCodecOptional(codec.codecForString), @@ -161,6 +162,8 @@ export interface CheckPaymentUnpaidResponse { // URI that the wallet must process to complete the payment. taler_pay_uri: string; + order_status_url: string; + // Alternative order ID which was paid for already in the same session. // Only given if the same product was purchased before in the same session. already_paid_order_id?: string; diff --git a/packages/taler-integrationtests/src/test-payment-multiple.ts b/packages/taler-integrationtests/src/test-payment-multiple.ts index b92513d44..2914b7181 100644 --- a/packages/taler-integrationtests/src/test-payment-multiple.ts +++ b/packages/taler-integrationtests/src/test-payment-multiple.ts @@ -137,5 +137,5 @@ runTest(async (t: GlobalTestState) => { t.assertTrue(orderStatus.order_status === "paid"); - await t.terminate(); + await t.shutdown(); }); diff --git a/packages/taler-integrationtests/src/test-payment.ts b/packages/taler-integrationtests/src/test-payment.ts index fe44c183f..cfe65a6f8 100644 --- a/packages/taler-integrationtests/src/test-payment.ts +++ b/packages/taler-integrationtests/src/test-payment.ts @@ -76,5 +76,5 @@ runTest(async (t: GlobalTestState) => { t.assertTrue(orderStatus.order_status === "paid"); - await t.terminate(); + await t.shutdown(); }); diff --git a/packages/taler-integrationtests/src/test-withdrawal.ts b/packages/taler-integrationtests/src/test-withdrawal.ts index 67720a8a2..a856560dc 100644 --- a/packages/taler-integrationtests/src/test-withdrawal.ts +++ b/packages/taler-integrationtests/src/test-withdrawal.ts @@ -64,5 +64,5 @@ runTest(async (t: GlobalTestState) => { const balResp = walletTypes.codecForBalancesResponse().decode(balApiResp.result); t.assertAmountEquals("TESTKUDOS:9.72", balResp.balances[0].available) - await t.terminate(); + await t.shutdown(); }); |