Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions tools/scripts/test_reports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ then
echo "Running MacOS"
CRUX_REPORT_DATE=$(date -v -1m +%Y_%m_01)
else
CRUX_REPORT_DATE=$(date -d "-1 month" +%Y_%m_01)
CRUX_REPORT_DATE=$(date -d "$(date +%Y-%m-01) -1 month" +%Y_%m_01)
fi
else
CRUX_REPORT_DATE="${REPORT_DATE}"
Expand Down Expand Up @@ -93,32 +93,38 @@ do
FAIL_LOG="${FAIL_LOG}Incorrect Status code ${STATUS_CODE} found for ${TEST_URL}\n"
FAIL=$((FAIL+1))
fi
# Pause before the next request to avoid hitting rate limits
sleep 1
done

for TEST_URL in ${TIMESERIES_URLS}
do
NUM_TESTS=$((NUM_TESTS+1))
if curl -s "${TEST_URL}" | grep -q "${REPORT_DATE}"
if curl -s "${TEST_URL}" --compressed | grep -q "${REPORT_DATE}"
then
echo "${REPORT_DATE} found in body for ${TEST_URL}"
else
echo "${REPORT_DATE} not found in body for ${TEST_URL}"
FAIL_LOG="${FAIL_LOG}${REPORT_DATE} not found in body for ${TEST_URL}\n"
FAIL=$((FAIL+1))
fi
# Pause before the next request to avoid hitting rate limits
sleep 1
done

for TEST_URL in ${CRUX_TIMESERIES_URLS}
do
NUM_TESTS=$((NUM_TESTS+1))
if curl -s "${TEST_URL}" | grep -q "${CRUX_REPORT_DATE}"
if curl -s "${TEST_URL}" --compressed | grep -q "${CRUX_REPORT_DATE}"
then
echo "${CRUX_REPORT_DATE} found in body for ${TEST_URL}"
else
echo "${CRUX_REPORT_DATE} not found in body for ${TEST_URL}"
FAIL_LOG="${FAIL_LOG}${CRUX_REPORT_DATE} not found in body for ${TEST_URL}\n"
FAIL=$((FAIL+1))
fi
# Pause before the next request to avoid hitting rate limits
sleep 1
done

FAIL_LOG="${FAIL_LOG}\nSee latest log in [GitHub Actions](https://github.com/HTTPArchive/httparchive.org/actions/workflows/monthly-report-checks.yml)
Expand Down