Orchestrata Ultimate › Tests › Reference › scripts › test_gate_parallel_safety

Tests reference — tests/scripts/test_gate_parallel_safety.py

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

Prose pending.

tests/scripts/test_gate_parallel_safety.py

source · 72 tests · 1392 lines

Kind Name Line Description
function test_fixture_docstring_mentioning_delete_is_not_flagged 62 The exact shape of the original false positive: a docstring naming the
function test_unscoped_delete_is_still_flagged 83 The fix must not weaken detection of a real unscoped delete.
function test_cypher_value_string_is_still_scanned 97 A triple-quoted Cypher VALUE (assigned, not a docstring) is still scanned
function test_docstring_line_numbers_marks_doc_not_code 112
function test_create_in_docstring_is_not_flagged 126 Gate 0.1 had the same latent defect: a docstring naming a constrained
function test_unscoped_create_is_still_flagged 142 A real CREATE on a constrained label without test_id is still caught.
function test_create_waived_by_gate_ok_on_same_line 161
function test_create_waived_by_gate_ok_on_line_above 172
function test_bare_gate_ok_without_reason_does_not_waive_create 184
function test_delete_waived_by_gate_ok_on_line_above 196
function test_bare_gate_ok_without_reason_does_not_waive_delete 208
function test_docstring_line_numbers_syntax_error_returns_empty_set 223 ast.parse raising SyntaxError must not blow up the gate — it
function test_gate_05_does_not_flag_a_write_spelled_inside_a_string_literal 230 A filesystem write is executable code; text that merely SPELLS one
function test_gate_05_still_sees_a_write_whose_arguments_are_literals 255 The exclusion is positional, not "contains a string".
function test_gate_05_treats_structural_punctuation_as_inert 274 A string ELEMENT of a list is "...", — the trailing comma must not
function test_enclosing_uses_tmp_false_when_no_enclosing_def 299 A write at module scope (no enclosing def/async def above it)
function test_gate_01_skips_unreadable_file 314
function test_gate_02_skips_unreadable_file 324
function test_gate_04_skips_unreadable_file 332
function test_gate_05_skips_unreadable_file 340
function test_gate_03_no_conftest_returns_no_violations 348
function test_gate_03_flags_cleanup_test_prefix_without_worker_scoping 355
function test_gate_03_cleanup_test_prefix_with_worker_scoping_is_clean 367
function test_gate_03_flags_session_scope_kg_driver_without_pool_size 380
function test_gate_03_kg_driver_with_pool_size_is_clean 395
function test_gate_04_flags_redis_write_with_no_scoping_and_no_test_id_def 409 A Redis write with neither a nearby scoping token nor an enclosing
function test_gate_04_redis_write_with_enclosing_test_id_def_is_clean 427 The write's KEY must actually derive from test_id — an unused
function test_gate_04_test_id_parameter_present_but_unused_still_flags 444 MAJOR REGRESSION coverage: test_id being a parameter of the
function test_gate_04_test_id_referenced_only_inside_a_nested_closure_still_flags 466 CLOSURE REGRESSION coverage: a nested def referencing test_id
function test_gate_04_wrapped_signature_with_test_id_param_is_not_flagged 496 D1: a multi-line def whose test_id parameter sits on its own
function test_gate_04_call_embedded_in_string_literal_is_not_flagged 519 D2: redis_client.set(...) spelled out inside a plain string is
function test_gate_04_genuinely_unscoped_write_is_still_flagged 535 The gate must still bite: a real call, no test_id parameter or
function test_gate_04_gate_ok_with_reason_waives_the_finding 551 A reasoned # gate-ok: marker on the write's own line waives it —
function test_gate_04_bare_gate_ok_without_reason_still_flags 567 A marker with nothing after the colon is not a waiver — same rule
function test_gate_04_unparseable_file_falls_back_and_is_reported 583 A file the AST parser cannot read must not become an invisible hole:
function test_gate_04_unparseable_file_def_test_id_on_literal_first_line_is_exempt 603 Boundary-fix coverage for the fallback's same-line ``def
function test_gate_04_local_alias_of_redis_client_is_resolved 632 B2 item 1: r = redis_client — a bare local alias — must resolve
function test_gate_04_attribute_target_alias_is_resolved 647 B2 item 2: holder.conn = redis_client binds holder.conn as a
function test_gate_04_pipeline_object_is_resolved 665 B2 item 3: pipe = redis_client.pipeline(); pipe.set(...) — the
function test_gate_04_async_alias_and_await_are_resolved 681 B2 item 4: conn = async_redis; await conn.set(...) — an aliased
function test_gate_04_verb_set_covers_the_full_destructive_command_list 710 B2 item 5: every verb in REDIS_WRITE_VERBS — including
function test_gate_04_constructor_argument_taints_the_wrapping_object 726 B2 item 6: cache = GovernanceCache(redis=redis_state_manager)
function test_gate_04_helper_delegation_without_test_id_still_flags 749 B2 item 7 / "write delegated to a helper": _seed(redis_client)
function test_gate_04_helper_delegation_with_test_id_argument_is_exempt 767 The interprocedural counterpart of the above: when the caller passes
function test_gate_04_self_excusing_test_names_no_longer_excuse_the_write 793 B3: three real tree sites (tests/kernel/test_session_manager_extended.py)
function test_gate_04_key_literal_ending_in__key_does_not_self_excuse 811 A second, independently-discovered instance of the same self-excusing
function test_gate_04_key_embedded_in_an_fstring_derives_from_test_id 827 Must-NOT-flag control: a key genuinely built from test_id via an
function test_gate_04_key_built_by_str_format_still_derives_from_test_id 841 Must-NOT-flag control for the narrowed _is_testid_derived Call
function test_gate_04_call_site_isolation_second_scoped_caller_does_not_exempt_the_first 858 THE BLOCKER: a shared helper _w(client, key) called from TWO
function test_gate_04_call_site_isolation_all_callers_scoped_is_clean 886 The other half of call-site isolation: when EVERY caller of a shared
function test_gate_04_shared_helper_flagged_from_multiple_unscoped_callers_is_not_duplicated 905 The SAME physical write is re-analyzed once per calling context; when
function test_gate_04_key_rebound_after_a_hardcoded_write_does_not_retroactively_exempt_it 926 FLOW-INSENSITIVITY regression: a local variable holding a hardcoded
function test_gate_04_pipeline_context_manager_alias_is_resolved 950 with redis_client.pipeline() as p: — the idiomatic context-manager
function test_gate_04_match_case_body_is_walked 968 match/case bodies must be walked like any other compound
function test_gate_04_helper_used_as_key_that_ignores_its_argument_still_flags 985 CALL-BRANCH OVER-TRUST regression: a helper that RECEIVES test_id
function test_gate_04_getattr_dispatched_write_is_detected 1006 getattr(redis_client, "set")(...) reaches the exact same mutation
function test_gate_04_lambda_body_write_is_detected 1022 A write reached only through a lambda body — e.g. the
function test_main_json_flag_prints_json_report 1051 DELIBERATELY REAL-TREE (the module's single real-tree integration test):
function test_main_text_output_blocking_gate_fails 1071 main()'s blocking FAIL branch (exit 1, "FAIL (n)" + "BLOCKING
function test_main_text_output_advisory_gate_warns_but_passes 1113 Gate 0.5 is ADVISORY: with a violation present, no --strict must not
function test_main_strict_flag_makes_advisory_gate_blocking 1135
function test_main_default_runs_all_gates 1156 No --gate flag -> every gate in GATES runs (gates_to_run = list(GATES)).
function test_gate_05_hardcoded_write_still_flags 1187 Detection is preserved: no tmp anything in reach -> violation.
function test_gate_05_wrapper_fixture_chain_is_isolated 1207 A 3-hop fixture chain (controller -> repo -> tmp_path, spanning
function test_gate_05_self_attribute_write_is_isolated 1242 os.path.join(self.<attr>, ...) targets are constructor-injected;
function test_gate_05_path_annotated_helper_param_is_isolated 1264 A helper whose write target is a : Path-annotated parameter is a
function test_gate_06_flags_a_loop_that_waits_for_a_port_to_be_free 1338 The exact guard deleted from tests/knowledge_graph/test_server.py.
function test_gate_06_does_not_flag_waiting_for_a_server_to_come_up 1347 connect_ex(...) == 0 is a readiness wait, not a shared-port guard.
function test_gate_06_waived_by_gate_ok_with_a_reason 1358
function test_gate_06_bare_gate_ok_without_reason_does_not_waive 1368 A waiver has to say why — an untagged escape hatch is not a decision.
function test_gate_06_skips_unreadable_file 1378
function test_gate_06_survives_a_file_it_cannot_parse 1390 A syntax error is another gate's finding, not a crash in this one.