Skip to content

Commit

Permalink
Merge pull request #67 from groezing/patch-1
Browse files Browse the repository at this point in the history
Update run to fix parameter access
  • Loading branch information
reggeenr authored Dec 6, 2023
2 parents 6a864eb + 7af1075 commit 4922590
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cloudant-change-listener/run
Original file line number Diff line number Diff line change
Expand Up @@ -243,27 +243,29 @@ echo "Verify job receives the Cloudant event by fetching the job run logs ..."

COUNTER=0
while true; do
sleep 3
echo "Waiting on job to detect change"
sleep 5
foundDetectedChange=$(ibmcloud ce jobrun logs -n ${job_run_name} | grep "Detected 1 change(s) in the DB")
foundCalledFunction=$(ibmcloud ce jobrun logs -n ${job_run_name} | grep "Successfully called CE function")

if [[ foundDetectedChange && foundCalledFunction ]]; then
if [[ $foundDetectedChange && $foundCalledFunction ]]; then
echo ""
echo "That was a success :)"
break;
fi
COUNTER=$((COUNTER+1))
if (( COUNTER > 60 )); then
if [[ foundDetectedChange ]]; then
if (( COUNTER > 20 )); then
if [[ ! $foundDetectedChange ]]; then
echo "Testing of the sample failed because the change was not detected"
fi
if [[ foundCalledFunction ]]; then
if [[ ! $foundCalledFunction ]]; then
echo "Testing of the sample failed because the ce function was not called "
fi
# Clean up
clean
exit 1;
fi
done;


# Clean up
clean

0 comments on commit 4922590

Please sign in to comment.