AtlatestRepositorycourier

courier / tree / reprorepro-single-poller.sh

1#!/usr/bin/env bash
2# Entry point for the single-poller + honest-send harness.
3#
4# Everything runs against repro/mock_telegram.py. NOTHING reaches real
5# Telegram: every courier started here has COURIER_TELEGRAM_API_URL pointed
6# at the local mock, which both the send and the poll path honour.
7#
8# The pre-fix CONTROL is not optional in spirit: case 1 asserts ZERO 409s,
9# and an absence assertion is worth nothing until the instrument has been
10# shown to detect the thing when it IS present. Build one with:
12# git worktree add /tmp/courier-control <pre-fix-sha>
13# (cd /tmp/courier-control && sigil deps install && sigil build)
14# COURIER_CONTROL_BIN=/tmp/courier-control/build/dev/bin/courier \
15# repro/repro-single-poller.sh
17# Without it the harness reports the control as FAILED rather than quietly
18# passing, because "we did not check" must not read as "it is fine".
19set -u
21HERE="$(cd "$(dirname "$0")" && pwd)"
22BIN="${COURIER_BIN:-$HERE/../build/dev/bin/courier}"
23PY="${PYTHON:-python3}"
25if [ ! -x "$BIN" ]; then
26 echo "FATAL: courier binary not found at $BIN (run 'sigil build' first)"
27 exit 2
28fi
30exec "$PY" "$HERE/single_poller_harness.py" --bin "$BIN" "$@"