Private
Public Access
Tasks are fire-and-forget only: function TASK:NAME(props : dval) and
task_execute(target, timeout_seconds, props). The durable queue, the
TASK_WORKERS pool with its leases, cancellation, admission health and recovery,
task, task_status, task_await, task_cancel, the background form of shell_exec,
job_status, job_result, job_await, job_cancel, http_request_async, the job
directory and its --job-worker helper, their pages, fixtures, guide sections,
settings documentation and parity rows are gone. A bare TASK handler is a
compile error.
shell_exec(command, {on_done: "/unit.capy:NAME"}) keeps the one job use that
mattered: the command runs in the detached task runner, and TASK:NAME of the
unit receives command, exit_code, stdout, stderr, timed_out and
output_truncated when it finishes. Unit path resolution is shared by tasks and
services. The tasks guide is "Tasks and commands" with a stable slug change.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
87 lines
2.6 KiB
Bash
Executable File
87 lines
2.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
socket_path="${BEARER_CLI_SOCKET:-/run/bearer/cli.sock}"
|
|
curl_timeout="${BEARER_CLI_TEST_TIMEOUT:-900}"
|
|
if [[ -z "${BEARER_CLI_SOCKET:-}" && -r /etc/bearer/settings.cfg ]]; then
|
|
configured_socket=$(awk -F= '/^[[:space:]]*CLI_SOCKET_PATH[[:space:]]*=/ {gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2; exit}' /etc/bearer/settings.cfg)
|
|
if [[ -n "${configured_socket:-}" ]]; then
|
|
socket_path="$configured_socket"
|
|
fi
|
|
fi
|
|
|
|
skip_local_service_pages=0
|
|
action="run"
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
--skip-local-service-pages)
|
|
skip_local_service_pages=1
|
|
shift
|
|
;;
|
|
--list)
|
|
action="list"
|
|
shift
|
|
;;
|
|
-h|--help)
|
|
cat <<'USAGE'
|
|
Usage: scripts/run_cli_tests.sh [--skip-local-service-pages] [--list]
|
|
|
|
Runs the BEARER unit-based test suite through the runtime CLI socket.
|
|
|
|
Environment:
|
|
BEARER_CLI_TEST_TIMEOUT Per CLI runner group curl timeout in seconds (default: 900).
|
|
USAGE
|
|
exit 0
|
|
;;
|
|
*)
|
|
echo "unknown option: $1" >&2
|
|
exit 2
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ ! -S "$socket_path" ]]; then
|
|
echo "BEARER CLI socket not found: $socket_path" >&2
|
|
exit 1
|
|
fi
|
|
|
|
base_url="http://localhost/tests/cli_runner.capy?action=${action}&skip_local_service_pages=${skip_local_service_pages}"
|
|
if [[ "$action" == "list" ]]; then
|
|
curl -sS --max-time "$curl_timeout" --fail-with-body --unix-socket "$socket_path" "$base_url"
|
|
exit 0
|
|
fi
|
|
|
|
if [[ "$action" == "run" ]]; then
|
|
scripts/test_session_state_native.sh
|
|
scripts/test_split_utf8_native.sh
|
|
scripts/test_fcgi_forward_native.sh
|
|
python3 scripts/check_capy_doc_examples.py --self-test
|
|
python3 scripts/check_capy_doc_examples.py
|
|
echo "== BEARER CLI health =="
|
|
curl -sS --max-time "$curl_timeout" --fail-with-body --unix-socket "$socket_path" "${base_url}&group=native"
|
|
scripts/test_wasm_core_smoke.sh
|
|
scripts/test_capy_phase1.sh
|
|
scripts/test_capy_reference.sh
|
|
scripts/test_markdown_to_html_native.sh
|
|
scripts/test_server_arguments.sh
|
|
scripts/test_socket_activation.sh
|
|
for test in \
|
|
scripts/test_capy_compile_timeout.sh \
|
|
scripts/test_cold_component_deadline.sh \
|
|
scripts/test_component_resolution_ttl.sh \
|
|
scripts/test_entry_freshness_ttl.sh \
|
|
scripts/test_log_timeliness.sh \
|
|
scripts/test_mysql_epoch_refresh.sh \
|
|
scripts/test_mysql_persistent_pool.sh \
|
|
scripts/test_nested_component_props.sh \
|
|
scripts/test_parallel_precompile.sh \
|
|
scripts/test_parallel_proactive_compile.sh \
|
|
scripts/test_password_hashing.sh \
|
|
scripts/test_raw_http_request_log.sh \
|
|
scripts/test_relative_component_cache.sh \
|
|
scripts/test_running_core_abi_pin.sh; do
|
|
"$test"
|
|
done
|
|
fi
|