Skip to content

Commit

Permalink
chore: fund the requestor in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptobench committed Oct 2, 2023
1 parent 7acfaee commit e70d7e6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ jobs:
- name: Build and start the docker containers
run: docker compose -f tests/e2e/docker-compose.yml up -d

- name: Fund the requestor
run: sleep 4 && docker exec -t e2e-requestor-1 /bin/sh -c "yagna payment fund"

- name: Start the e2e test
run: sleep 4 && docker exec -t e2e-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run test:e2e"
run: docker exec -t e2e-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run test:e2e"

#region Cypress test execution
- name: Run web server
Expand Down
44 changes: 23 additions & 21 deletions tests/e2e/start-requestor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,33 @@ get_funds_from_faucet() {
yagna payment fund
}

echo "Starting Yagna in the background to get funds from the faucet"
yagna service run >/dev/null 2>&1 &
sleep 1
# echo "Starting Yagna in the background to get funds from the faucet"
echo "Starting Yagna"
# yagna service run >/dev/null 2>&1 &
yagna service run
# sleep 1

PID=$(pgrep -f "yagna service run")
echo "Yagna is running with PID: $PID"
# PID=$(pgrep -f "yagna service run")
# echo "Yagna is running with PID: $PID"

sleep 4
# sleep 4

echo "I will now try to get funds from the faucet"
FUNDING_STATUS="NO"
# echo "I will now try to get funds from the faucet"
# FUNDING_STATUS="NO"

while [[ $FUNDING_STATUS == "NO" ]]; do
if get_funds_from_faucet; then
echo "Funds received from the faucet"
FUNDING_STATUS="OK"
else
echo "Error receiving funds from the faucet. We're retrying..."
fi
done
# while [[ $FUNDING_STATUS == "NO" ]]; do
# if get_funds_from_faucet; then
# echo "Funds received from the faucet"
# FUNDING_STATUS="OK"
# else
# echo "Error receiving funds from the faucet. We're retrying..."
# fi
# done

stop_yagna=$(kill -9 $PID)
# stop_yagna=$(kill -9 $PID)

echo "Stopped Yagna"
sleep 4
# echo "Stopped Yagna"
# sleep 4

echo "Starting Yagna again to run it in the foreground"
yagna service run
# echo "Starting Yagna again to run it in the foreground"
# yagna service run

0 comments on commit e70d7e6

Please sign in to comment.