Orchestrata Ultimate › Tests › Reference › scripts › test_check_prod_tree_separation

Tests reference — tests/scripts/test_check_prod_tree_separation.py

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

Prose pending.

tests/scripts/test_check_prod_tree_separation.py

source · 51 tests · 799 lines

Tests for scripts/check_prod_tree_separation.py — the RUL-027 gate

Kind Name Line Description
function test_clean_units_produce_no_violations 19
function test_working_directory_on_the_dev_tree_is_a_violation 29
function test_every_path_directive_is_checked 45 A unit can reach the dev tree via EnvironmentFile/ExecStart too, not
function test_environment_pythonpath_into_the_dev_tree_is_a_violation 65 An exported PYTHONPATH OUTRANKS the checkout's own .pth, so
function test_environment_not_naming_the_dev_tree_is_clean 88 Only Environment values that reach INTO the dev tree are violations.
function test_description_naming_the_tree_is_not_a_violation 102 Only PATH-bearing directives bind production to a checkout: a
function test_commented_lines_are_ignored 117
function test_units_outside_all_default_globs_are_out_of_scope 127 The default globs bound the gate to orchestrata-/orchgraph-/timers:
function test_orchgraph_service_is_in_scope 136 orchgraph-* units are examined exactly like orchestrata-* units;
function test_standard_output_into_the_dev_tree_is_a_violation 154 StandardOutput/Error/Input and RootDirectory are path directives too.
function test_timer_unit_is_examined_and_counted_with_a_clean_body 170 A *.timer unit is in scope even without a path directive: its Unit=
function test_default_globs_cover_service_and_timer_prefixes 198
function test_path_directives_include_the_standard_stream_and_root_directives 206
function test_find_violations_still_accepts_a_single_string_glob 215 Backward compatibility: glob may still be passed as a plain string.
function test_main_returns_1_and_names_the_offender 229
function test_main_returns_0_when_separated 248
function test_a_machine_with_no_units_is_not_a_violation 265 A box that does not run production cannot have production mis-pointed.
function test_cli_glob_flag_is_repeatable 272 --glob is repeatable and overrides DEFAULT_GLOBS entirely.
function test_plain_unit_under_a_workspace_checkout_is_a_violation_with_its_own_reason 321
function test_the_same_path_via_dev_tree_reports_the_dev_tree_reason_too 346 Both rules may fire on one line; each is reported under its own reason,
function test_a_dev_tree_hit_outside_the_workspace_keeps_only_the_dev_tree_reason 372
function test_template_unit_taking_the_checkout_as_percent_i_is_clean 386 ADR-0067 R1: the checkout is the %I runtime parameter -- DATA -- so the
function test_template_and_instance_units_are_exempt_from_the_workspace_rule 401 The exemption is by unit NAME (@ in it), so a template or instance
function test_template_exemption_does_not_exempt_the_dev_tree_rule 413
function test_plain_unit_under_opt_is_clean 425
function test_the_workspace_rule_covers_exec_start_and_working_directory_only 448 ExecStart / ExecStartPre / ExecStartPost / WorkingDirectory decide what
function test_workspace_shape_is_home_user_workspace_on_the_normalised_path 483
function test_the_workspace_rule_does_not_follow_symlinks 493 The unit file's text is the evidence: a path spelled outside any
function test_a_timer_is_still_examined_by_the_workspace_rule 508
function test_orchgraph_plain_unit_in_a_workspace_is_a_violation 533
function test_percent_h_working_directory_is_a_workspace_violation 568
function test_percent_h_exec_start_is_a_workspace_violation 574
function test_percent_h_under_a_home_outside_home_star_is_not_a_violation 582 ADR-0067 decision 4 defines the violation literally as
function test_percent_h_expands_to_the_managers_home 598
function test_a_backslash_continuation_is_one_directive_reported_at_its_first_line 602
function test_a_continuation_does_not_swallow_the_next_directive 614
function test_an_unterminated_trailing_continuation_is_still_examined 619
function test_the_at_exec_prefix_is_stripped 626
function test_every_exec_prefix_is_stripped 633
function test_a_double_quoted_executable_is_a_workspace_violation 639
function test_a_single_quoted_prefixed_executable_is_a_workspace_violation 645
function test_the_other_exec_directives_are_workspace_directives 656
function test_a_clean_continuation_and_prefixed_quoted_opt_path_stay_clean 665
function test_a_workspace_only_hit_does_not_claim_the_unit_points_at_this_tree 676 The FAIL trailer names what was actually found: a workspace-rule hit says
function test_a_dev_tree_only_hit_keeps_the_points_here_trailer 696
function test_a_workspace_only_header_does_not_name_the_dev_tree 715
function test_both_reasons_on_two_lines_print_both_trailers_and_count_two 733 One line only under --dev-tree, one only under a workspace: two
function test_the_dev_tree_rule_matches_a_joined_continuation_line 760 The --dev-tree rule reads the logical line too: a dev-tree path on the
function test_an_escaped_trailing_backslash_is_not_a_continuation 776 systemd continues only on an UNESCAPED trailing backslash: \\ at the
function test_three_trailing_backslashes_still_continue 784
function test_a_comment_line_inside_a_continuation_is_skipped_not_terminating 791 systemd joins across a comment line inside a continuation