Skip to content

Commit 02c274e

Browse files
authored
Relaxing tests when play is down (#2131)
1 parent 8993b40 commit 02c274e

File tree

1 file changed

+30
-13
lines changed

1 file changed

+30
-13
lines changed

.github/workflows/jobs.yaml

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,6 +1446,15 @@ jobs:
14461446
echo "Create the folder to put the all.out file"
14471447
TARGET_BUCKET=`echo $RANDOM | md5sum | head -c 20; echo;`
14481448
echo "TARGET_BUCKET: ${TARGET_BUCKET}"
1449+
echo "Only run our test if play is up and running..."
1450+
PLAY_IS_ON=`wget --spider --server-response https://play.min.io:9443/login 2>&1 | grep '200\ OK' | wc -l`
1451+
if [ $PLAY_IS_ON == 1 ]
1452+
then
1453+
echo "Play is up and running, we will proceed with the test"
1454+
else
1455+
echo "Play is down, please report it on hack channel"
1456+
exit
1457+
fi
14491458
./mc mb --ignore-existing play/${TARGET_BUCKET}/
14501459
./mc version enable play/${TARGET_BUCKET}
14511460
# Via API we are going to test:
@@ -1588,19 +1597,27 @@ jobs:
15881597
wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
15891598
echo "Change the permissions to execute mc command"
15901599
chmod +x mc
1591-
echo "Create the folder to put the all.out file"
1592-
./mc mb --ignore-existing play/builds/
1593-
echo "Copy the all.out file to play bucket"
1594-
echo ${{ github.repository }}
1595-
echo ${{ github.event.number }}
1596-
echo ${{ github.run_id }}
1597-
# mc cp can fail due to lack of space: mc: <ERROR> Failed to copy `all.out`.
1598-
# Storage backend has reached its minimum free disk threshold. Please delete a few objects to proceed.
1599-
./mc cp all.out play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
1600-
./mc cp all.out play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
1601-
go tool cover -html=all.out -o coverage.html
1602-
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
1603-
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
1600+
echo "Only run our test if play is up and running since we require it for replication tests here."
1601+
PLAY_IS_ON=`wget --spider --server-response https://play.min.io:9443/login 2>&1 | grep '200\ OK' | wc -l`
1602+
if [ $PLAY_IS_ON == 1 ]
1603+
then
1604+
echo "Play is up and running, we will proceed with the play part for coverage"
1605+
echo "Create the folder to put the all.out file"
1606+
./mc mb --ignore-existing play/builds/
1607+
echo "Copy the all.out file to play bucket"
1608+
echo ${{ github.repository }}
1609+
echo ${{ github.event.number }}
1610+
echo ${{ github.run_id }}
1611+
# mc cp can fail due to lack of space: mc: <ERROR> Failed to copy `all.out`.
1612+
# Storage backend has reached its minimum free disk threshold. Please delete a few objects to proceed.
1613+
./mc cp all.out play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
1614+
./mc cp all.out play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
1615+
go tool cover -html=all.out -o coverage.html
1616+
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
1617+
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
1618+
else
1619+
echo "Play is down, please report it on hack channel, no coverage is going to be uploaded!!!"
1620+
fi
16041621
echo "grep to obtain the result"
16051622
go tool cover -func=all.out | grep total > tmp2
16061623
result=`cat tmp2 | awk 'END {print $3}'`

0 commit comments

Comments
 (0)