Skip to content

Commit 81113bc

Browse files
committed
update template tests to start the app
Signed-off-by: Karthik Ganeshram <[email protected]>
1 parent b2b0cb9 commit 81113bc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/test.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,31 @@ jobs:
8787
run: |
8888
cd test-project
8989
spin build
90+
91+
- name: Test the application
92+
run: |
93+
cd test-project
94+
spin up &
95+
SPIN_PID=$!
96+
97+
echo "Waiting for Spin to start..."
98+
99+
for i in {1..5}; do
100+
STATUS=$(curl -o /dev/null -s -w "%{http_code}" http://127.0.0.1:3000)
101+
102+
if [ "$STATUS" -eq 200 ]; then
103+
echo "✅ Spin responded with 200 on attempt $i"
104+
break
105+
fi
106+
107+
echo "Attempt $i: status $STATUS, retrying in 2s..."
108+
sleep 2
109+
done
110+
111+
kill $SPIN_PID
112+
113+
if [ "$STATUS" -ne 200 ]; then
114+
echo "❌ Application failed to return 200 after 5 attempts"
115+
exit 1
116+
fi
117+

0 commit comments

Comments
 (0)