mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-22 17:48:15 +00:00
* bots, tests: run broadcast bot test in CI * tests: test moderation that arrives before the message * ci, tests: run all tests in CI * tests: update re-enabled tests, restore query plans, PostgreSQL schema from CI * tests: remove CI skip helpers no longer used * tests: expect XFTP AUTH error of cancelled standalone file * tests: update query plans from CI * tests: update query plans from CI * tests: expect group history and member contacts in async group test * tests: accept subscription summary after first events on restart * tests: make AUTH and client timeout direct tests deterministic * tests: keep bob's badge clock before renewal until the move back * tests: keep the quota of 2 messages only on the member's receive queue * tests: keep query plans files with repeated entries of one query * tests: update query plans from CI * tests: stop the host before a member requests to join with a badge * tests: remove repeated entries of one query from query plans files * tests: accept the refusal of an unknown remote host after its session code * ci: state when the query plans test fails * tests: skip multicast discovery on macOS CI runners * tests: accept a remote host started with one local address * tests: restore the client timeout test except its zero timeout * tests: fail when a remote host prints another line than its other addresses * ci: name the tests that overwrite generated files * tests: move the badge clock after the restoring device arms its wake * tests: keep both members on the quota server in the member inactivity test * tests: accept subscription summaries in any order in the async group test * tests: update query plans from CI * tests: quota of 2 only on bob's queues in member inactivity test * tests: connect to a deleted link after its queue is deleted * core: save relay connection before requesting relay link data * core: share relay connection creation between join and retry * tests: connect to a re-added relay when its connection is saved late * tests: delay only the relay connection record, not the command * tests: record API fixtures on SQLite only * core: update query plans * ci: run PostgreSQL tests with the steps of build-linux
42 lines
897 B
Bash
Executable File
42 lines
897 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
if [ "$#" -eq 0 ]; then
|
|
echo "usage: $0 <test command>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ -n "${PR_BODY:-}" ]; then
|
|
TESTS=$(printf '%s\n' "$PR_BODY" | tr -d '\r' | awk '/^```ci-tests[ \t]*$/ {f = 1; next} /^```[ \t]*$/ {f = 0} f')
|
|
fi
|
|
args=()
|
|
while read -r p; do
|
|
if [ -n "$p" ]; then args+=(-m "$p"); fi
|
|
done <<< "${TESTS:-}"
|
|
if [ "${#args[@]}" -gt 0 ]; then
|
|
if [ "${ALLOW_EMPTY:-}" != true ]; then args+=(--fail-on=empty); fi
|
|
elif [ "${REDUCED:-}" = true ]; then
|
|
echo "No tests selected"
|
|
exit 0
|
|
fi
|
|
|
|
i=1
|
|
attempts=${ATTEMPTS:-1}
|
|
while [ "$i" -le "$attempts" ]; do
|
|
if "$@" "${args[@]}"; then
|
|
break
|
|
elif [ "$?" -eq 124 ]; then
|
|
echo "Attempt $i timed out."
|
|
fi
|
|
if [ "$i" -lt "$attempts" ]; then
|
|
echo "Attempt $i failed, retrying..."
|
|
sleep 1
|
|
fi
|
|
i=$((i + 1))
|
|
done
|
|
if [ "$i" -gt "$attempts" ]; then
|
|
echo "Attempt $attempts failed."
|
|
exit 1
|
|
fi
|