fix: update endpoint check script to differentiate between failures and slow endpoints

This commit is contained in:
mirage
2026-03-27 13:13:54 +01:00
parent 7acd0bd739
commit 54d6568242

View File

@@ -51,11 +51,17 @@ jobs:
bash scripts/test-endpoints.sh http://localhost:5038 1000 2>&1 | tee /tmp/webzine_endpoint_output.txt
EXIT_CODE=${PIPESTATUS[0]}
FAIL_COUNT=$(grep -cE "^\[(LENT|ÉCHEC)\]" /tmp/webzine_endpoint_output.txt 2>/dev/null || echo 0)
echo "failed=$FAIL_COUNT" >> "$GITHUB_OUTPUT"
echo "exit_code=$EXIT_CODE" >> "$GITHUB_OUTPUT"
# Count failures (but not slow endpoints as failures)
FAIL_COUNT=$(grep -cE "^\[ÉCHEC\]" /tmp/webzine_endpoint_output.txt 2>/dev/null || echo 0)
SLOW_COUNT=$(grep -cE "^\[LENT\]" /tmp/webzine_endpoint_output.txt 2>/dev/null || echo 0)
exit $EXIT_CODE
echo "failed=$FAIL_COUNT" >> "$GITHUB_OUTPUT"
echo "slow=$SLOW_COUNT" >> "$GITHUB_OUTPUT"
# Only fail if there are actual failures
if [ $FAIL_COUNT -gt 0 ]; then
exit 1
fi
- name: Post performance report as PR comment
if: always()