Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(ci): Run UI tests only for 15mins max in case of build failure (#1718)

Jagan16a2c46affbd
diff --git a/.github/scripts/run_ui_tests.sh b/.github/scripts/run_ui_tests.sh
index 2cd1e6f07b..17cc79bc7c 100644
--- a/.github/scripts/run_ui_tests.sh
+++ b/.github/scripts/run_ui_tests.sh
@@ -1,15 +1,17 @@
-#! /usr/bin/env bash
+#!/bin/bash
sudo apt update
apt install net-tools
mkdir tests
+COUNT=0
#download connector ui tests
while [ ! -f $HOME/target/test/connector_tests.json ]
do
- if [ $SECONDS > 20 ]
+ if [ $COUNT -gt 10 ];
then
exit 1
fi
+ COUNT=$((COUNT+1))
sleep 2
wget $UI_TESTCASES_PATH && mv testcases $HOME/target/test/connector_tests.json
done
@@ -20,12 +22,15 @@ $GECKOWEBDRIVER/geckodriver > tests/geckodriver.log 2>&1 &
#start server and run ui tests
cargo run &
+COUNT=0
#Wait for the server to start in port 8080
while netstat -lnt | awk '$4 ~ /:8080$/ {exit 1}'; do
- if [ $SECONDS > 900 ]
+ #Wait for 15mins to start otherwise kill the task
+ if [ $COUNT -gt 90 ];
then
exit 1
else
+ COUNT=$((COUNT+1))
sleep 10
fi
done