gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated (e9864adf -> f6d81037)


From: gnunet
Subject: [taler-wallet-core] branch master updated (e9864adf -> f6d81037)
Date: Tue, 18 Aug 2020 09:28:09 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a change to branch master
in repository wallet-core.

    from e9864adf integration test fixes
     new 2aeff3a9 test runner
     new f6d81037 fixes for test-paywall-flow

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/test-paywall-flow.ts                       | 33 ++++++++++++++++------
 packages/taler-integrationtests/testrunner         | 14 +++++++++
 2 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/packages/taler-integrationtests/src/test-paywall-flow.ts 
b/packages/taler-integrationtests/src/test-paywall-flow.ts
index 0671fecb..5214acc4 100644
--- a/packages/taler-integrationtests/src/test-paywall-flow.ts
+++ b/packages/taler-integrationtests/src/test-paywall-flow.ts
@@ -82,14 +82,14 @@ runTest(async (t: GlobalTestState) => {
     );
   }
 
-  let pubUnpaidStatusResp = codecForMerchantOrderStatusUnpaid().decode(
+  let pubUnpaidStatus = codecForMerchantOrderStatusUnpaid().decode(
     publicOrderStatusResp.data,
   );
 
-  console.log(pubUnpaidStatusResp);
+  console.log(pubUnpaidStatus);
 
   let preparePayResp = await wallet.preparePay({
-    talerPayUri: pubUnpaidStatusResp.taler_pay_uri,
+    talerPayUri: pubUnpaidStatus.taler_pay_uri,
   });
 
   t.assertTrue(preparePayResp.status === PreparePayResultType.PaymentPossible);
@@ -106,7 +106,7 @@ runTest(async (t: GlobalTestState) => {
     );
   }
 
-  let pubUnpaidStatus = codecForMerchantOrderStatusUnpaid().decode(
+  pubUnpaidStatus = codecForMerchantOrderStatusUnpaid().decode(
     publicOrderStatusResp.data,
   );
 
@@ -120,10 +120,12 @@ runTest(async (t: GlobalTestState) => {
     validateStatus: () => true,
   });
 
-  if (publicOrderStatusResp.status != 410) {
+  console.log(publicOrderStatusResp.data);
+
+  if (publicOrderStatusResp.status != 202) {
     console.log(publicOrderStatusResp.data);
     throw Error(
-      `expected status 410 (after paying), but got 
${publicOrderStatusResp.status}`,
+      `expected status 202 (after paying), but got 
${publicOrderStatusResp.status}`,
     );
   }
 
@@ -190,6 +192,17 @@ runTest(async (t: GlobalTestState) => {
   t.assertTrue(preparePayResp.status === 
PreparePayResultType.AlreadyConfirmed);
   t.assertTrue(preparePayResp.paid);
 
+  // The first order should now be paid under "mysession-three",
+  // as the wallet did re-purchase detection
+  orderStatus = await merchant.queryPrivateOrderStatus({
+    orderId: firstOrderId,
+    sessionId: "mysession-three",
+  });
+
+  t.assertTrue(orderStatus.order_status === "paid");
+
+  // Now check if the public status of the new order is correct.
+
   console.log("requesting public status", publicOrderStatusUrl);
 
   // Ask the order status of the claimed-but-unpaid order
@@ -197,9 +210,9 @@ runTest(async (t: GlobalTestState) => {
     validateStatus: () => true,
   });
 
-  if (publicOrderStatusResp.status != 403) {
+  if (publicOrderStatusResp.status != 402) {
     throw Error(
-      `expected status 403, but got ${publicOrderStatusResp.status}`,
+      `expected status 402, but got ${publicOrderStatusResp.status}`,
     );
   }
 
@@ -207,5 +220,7 @@ runTest(async (t: GlobalTestState) => {
     publicOrderStatusResp.data,
   );
 
-  t.assertTrue(pubUnpaidStatusResp.already_paid_order_id === firstOrderId);
+  console.log(publicOrderStatusResp.data);
+
+  t.assertTrue(pubUnpaidStatus.already_paid_order_id === firstOrderId);
 });
diff --git a/packages/taler-integrationtests/testrunner 
b/packages/taler-integrationtests/testrunner
index 03cb15b3..c03f6ed9 100755
--- a/packages/taler-integrationtests/testrunner
+++ b/packages/taler-integrationtests/testrunner
@@ -8,6 +8,13 @@
 
 set -eu
 
+exit_int() {
+  echo "Interrupted..."
+  exit 2
+}
+
+trap "exit_int" INT
+
 if [ "$#" -ne 1 ]; then
     echo "Usage: $0 TESTGLOB"
     exit 1
@@ -27,6 +34,8 @@ num_exec=0
 num_fail=0
 num_succ=0
 
+files_failed=''
+
 # Glob tests
 for file in lib/$1?(.js); do
   case "$file" in
@@ -41,6 +50,7 @@ for file in lib/$1?(.js); do
           ;;
         *)
           num_fail=$((num_fail+1))
+          files_failed=$files_failed:$file
           ;;
       esac
       ;;
@@ -53,6 +63,10 @@ done
 echo "-----------------------------------"
 echo "Tests finished"
 echo "$num_succ/$num_exec tests succeeded"
+if [[ $num_fail != 0 ]]; then
+  echo "These tests failed:"
+  echo $files_failed | tr : \\n | sed '/^$/d'
+fi
 echo "-----------------------------------"
 
 if [[ $num_fail = 0 ]]; then

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]