Orchestrata Ultimate › Tests › Reference › scripts › test_ast_daemon

Tests reference — tests/scripts/test_ast_daemon.py

Module of tests/scripts, split out because the directory page would be too large.

Prose pending.

tests/scripts/test_ast_daemon.py

source · 43 tests · 1325 lines

Tests for scripts/ast_daemon.py — the per-repo warm AST daemon (Unix

Kind Name Line Description
function test_health_responds_with_expected_shape 215
function test_unknown_query_cmd_returns_400 227
function test_query_parity_symbols 237
function test_query_parity_refs 247
function test_query_parity_who_imports 260
function test_query_parity_find_cycles 273
function test_query_parity_call_graph 283
function test_call_graph_not_found_is_a_real_none_not_a_daemon_miss 296 build_call_graph legitimately returns None for an unknown
function test_query_parity_complexity 312
function test_file_edit_bumps_generation_and_new_symbol_appears 330
function test_second_prepare_on_same_socket_returns_none 363 The flock is the correctness backstop for concurrent spawns — a
function test_idle_self_exit 390
function test_sigterm_graceful_shutdown_real_subprocess 422 A REAL ast_daemon.py process, sent a REAL SIGTERM, must clean up
function test_cli_delegation_uses_daemon_when_socket_present 473
function test_cli_delegation_falls_back_when_socket_absent 502 --no-cache keeps the local-computation fallback path scoped to
function test_cli_falls_back_when_socket_is_stale 535 A socket PATH that exists on disk but has nothing listening (e.g. a
function test_cli_no_daemon_flag_forces_local 568 --no-cache alongside --no-daemon: see
function test_query_ast_daemon_falls_back_on_non_200_query_response 601 query_ast_daemon called with a command the (real, live) daemon's
function test_cli_verbose_prints_the_daemon_identity_line 636 --verbose configures DEBUG logging, so the identity line reaches
function test_client_logs_daemon_identity_once_per_process 671 query_ast_daemon logs the daemon's /health identity at DEBUG
function test_hook_bash_syntax_ok 707
function test_hook_source_has_no_checkout_spawn 714 ADR-0067: the hook never spawns a daemon from a checkout venv. The
function test_load_ast_api_raises_import_error_when_spec_unresolvable 730 Mirrors test_ast_api.py's own _load_tool coverage test: redirect
function test_watch_loop_survives_and_returns_on_watchfiles_error 742 A nonexistent watch path makes watchfiles.watch() raise
function test_query_endpoint_returns_500_on_handler_exception 757 refs requires params.name — omitting it raises KeyError
function test_pid_alive_false_for_a_dead_pid 767
function test_pid_alive_true_for_a_pid_owned_by_another_user 773 PID 1 (init/systemd) exists but is not owned by the test user —
function test_cleanup_stale_treats_a_corrupt_pidfile_as_stale 781
function test_default_cache_is_not_the_committed_ast_artifact 794 The daemon must never default its cache onto the tracked
function test_session_daemon_fixture_is_live 811 The tests/scripts session fixture (conftest.py session_ast_daemon)
function test_daemon_serves_repo_root_from_foreign_cwd_with_identity 901 (a) + (b): a REAL daemon process whose cwd is unrelated to the served
function test_repo_root_defaults_to_cwd_and_is_listed_in_help 956
function test_read_deployed_commit_parses_version_and_tolerates_absence 965 (c): the sha on the commit <sha> line, else None.
function test_toolkit_repo_root_resolves_relative_sources_like_a_cli_run_inside 982 (d): with the root configured and the cwd elsewhere, relative-source
function test_toolkit_configure_repo_root_none_restores_cwd_resolution 999 (e): configure_repo_root(None) hands relative sources back to the
function test_deployed_commit_found_in_install_prefix_and_captured_once 1048 F1 + F2: install-tools.sh stamps <prefix>/VERSION while the code
function test_nonexistent_or_file_repo_root_is_refused_before_anything_is_created 1097 F3: exit 2 with a stderr message and no .claude/run side effects.
function test_help_with_repo_root_survives_a_deleted_cwd 1115 F4: the parser never reads the cwd while building, so a daemon started
function test_foreign_cwd_defaults_land_under_repo_and_watcher_and_check_deps_work 1145 F5 + F6: with no --socket/--cache the socket and cache resolve under
function test_prepare_hands_the_repo_anchored_default_cache_to_the_toolkit 1214 N2: what _prepare passes to configure_parse_cache (not just the
function test_deleted_cwd_without_repo_root_exits_2_with_a_message 1241 N1: no --repo-root and a removed cwd is a refusal, not a traceback.
function test_unstamped_version_falls_through_to_the_prefix_version 1265 A stray lib/VERSION with no commit line does not hide
function test_toolkit_get_routes_wait_on_cache_lock_but_health_does_not 1278 F9: a GET route served from ast_api runs under the same cache_lock