Orchestrata Ultimate › Tests › Reference › scripts › test_check_generated_artifacts
Tests reference — tests/scripts/test_check_generated_artifacts.py
Module of tests/scripts, split out because the directory page would be too large.
Prose pending.
tests/scripts/test_check_generated_artifacts.py
source · 60 tests · 808 lines
Tests for scripts/check_generated_artifacts.py — the RUL-030 gate.
| Kind | Name | Line | Description |
|---|---|---|---|
| class | TestTheViolationsTheRulingNames |
48 | |
| method | TestTheViolationsTheRulingNames.test_a_gitignored_artifact_is_a_violation_naming_the_rule |
49 | The failure has to name the .gitignore line, because that line is |
| method | TestTheViolationsTheRulingNames.test_an_untracked_artifact_that_exists_is_a_violation |
65 | |
| method | TestTheViolationsTheRulingNames.test_a_tracked_artifact_passes |
74 | |
| method | TestTheViolationsTheRulingNames.test_a_tracked_but_DIRTY_artifact_still_passes |
83 | Regeneration cadence is not this ruling's business. Requiring clean |
| method | TestTheViolationsTheRulingNames.test_an_artifact_that_was_never_generated_here_is_not_a_violation |
96 | Absent AND untracked means the generator never ran on this machine. |
| class | TestGlobEntries |
108 | Some generators emit a CLASS of files -- generate_pytest.py alone |
| method | TestGlobEntries.test_a_glob_checks_every_match |
113 | |
| method | TestGlobEntries.test_a_glob_matching_nothing_is_reported_not_silently_dropped |
126 | The dangerous direction. A glob that quietly expands to zero paths |
| method | TestGlobEntries.test_the_registry_uses_a_glob_for_the_generated_test_corpus |
136 | |
| class | TestItCannotReportAPassItDidNotEarn |
143 | The defect class this repo keeps paying for: a checker whose |
| method | TestItCannotReportAPassItDidNotEarn.test_an_empty_registry_is_INVALID_not_a_pass |
147 | |
| method | TestItCannotReportAPassItDidNotEarn.test_a_registry_that_examines_nothing_is_INVALID_not_a_pass |
155 | Zero violations across zero examined artifacts is the false green. |
| method | TestItCannotReportAPassItDidNotEarn.test_the_exit_codes_are_distinct |
165 | |
| class | TestTheRegistryAndItsBoundary |
169 | |
| method | TestTheRegistryAndItsBoundary.test_the_registry_is_not_empty |
170 | |
| method | TestTheRegistryAndItsBoundary.test_every_artifact_names_its_generator_and_its_consumer |
173 | The three-property boundary requires an artifact be derived and |
| method | TestTheRegistryAndItsBoundary.test_every_exclusion_carries_a_reason |
180 | An exclusion without a reason is a silent carve-out -- the exact |
| method | TestTheRegistryAndItsBoundary.test_no_path_is_both_registered_and_excluded |
187 | |
| class | TestAgainstTheLiveRepo |
193 | |
| method | TestAgainstTheLiveRepo.test_this_repository_satisfies_RUL_030 |
194 | The gate's own subject: every generated artifact this repo declares |
| method | TestAgainstTheLiveRepo.test_the_full_codebase_map_is_tracked |
201 | Regression guard for the violation that prompted the ruling: |
| method | TestAgainstTheLiveRepo.test_every_registered_generator_still_exists |
208 | The FORWARD half against the real registry: this repo's own |
| class | TestGeneratorPathHint |
228 | _generator_path_hint -- which registry generator strings name a |
| method | TestGeneratorPathHint.test_accepts_a_script_invocation |
232 | |
| method | TestGeneratorPathHint.test_rejects_a_bare_external_tool |
235 | |
| method | TestGeneratorPathHint.test_rejects_a_home_relative_path |
239 | |
| method | TestGeneratorPathHint.test_rejects_prose |
245 | |
| method | TestGeneratorPathHint.test_rejects_the_empty_string |
253 | |
| class | TestGeneratorPathCandidates |
257 | _generator_path_candidates -- shared resolution between on-disk |
| method | TestGeneratorPathCandidates.test_a_slash_token_is_only_itself |
261 | |
| method | TestGeneratorPathCandidates.test_a_bare_word_with_no_dot_has_no_candidates |
264 | |
| method | TestGeneratorPathCandidates.test_a_dotted_module_expands_under_every_known_root |
267 | |
| class | TestForwardGeneratorCheck |
274 | check_generators_exist -- for every registry entry with a checkable |
| method | TestForwardGeneratorCheck.test_a_generator_that_exists_passes |
278 | |
| method | TestForwardGeneratorCheck.test_a_deleted_generator_is_reported_as_LOSS |
288 | Reproduces the 6a186c9d shape: the generator existed, was |
| method | TestForwardGeneratorCheck.test_a_generator_that_never_existed_is_NEVER_EXISTED |
312 | |
| method | TestForwardGeneratorCheck.test_names_the_count_and_never_truncates_silently |
322 | |
| method | TestForwardGeneratorCheck.test_an_external_tool_generator_is_not_checked |
336 | 'uv' and 'terraform init' have no repo path to check -- they must |
| class | TestGitDeletionDetection |
350 | _git_deleted_path -- distinguishing LOSS from NEVER-EXISTED via git |
| method | TestGitDeletionDetection.test_a_committed_then_deleted_file_is_found |
354 | |
| method | TestGitDeletionDetection.test_a_directory_generator_deletion_is_found |
370 | The exact shape of the real incident: a whole package directory |
| method | TestGitDeletionDetection.test_a_token_never_committed_returns_none |
389 | |
| class | TestHeaderDiscovery |
393 | scan_generator_headers / check_generator_headers -- the DISCOVERY |
| method | TestHeaderDiscovery.test_a_header_generator_that_exists_passes |
398 | |
| method | TestHeaderDiscovery.test_the_historical_scenario_ast_serializer_testgen |
411 | THE demonstration: construct the exact 6a186c9d shape end to end |
| method | TestHeaderDiscovery.test_a_header_generator_that_never_existed |
448 | |
| method | TestHeaderDiscovery.test_prose_header_claims_are_not_flagged |
460 | "Generated by the protocol buffer compiler." names an external |
| method | TestHeaderDiscovery.test_the_header_window_bounds_the_read |
476 | Regression guard for a real false positive found while building |
| method | TestHeaderDiscovery.test_a_glob_matching_generator_that_exists_via_a_bare_filename |
492 | The bare-filename shape ("Generated by generate_pytest.py") -- |
| method | TestHeaderDiscovery.test_a_literal_path_generator_with_a_slash_exists |
510 | The literal-relative-path shape, e.g. "Generated by scripts/mygen.py" |
| method | TestHeaderDiscovery.test_a_literal_path_generator_with_a_slash_that_never_existed |
523 | A slash-containing token short-circuits straight to NEVER-EXISTED |
| method | TestHeaderDiscovery.test_a_dotted_module_that_resolves_to_a_plain_file |
537 | Dotted notation whose real location is a single module FILE, not |
| method | TestHeaderDiscovery.test_an_unreadable_file_is_skipped_not_crashed_on |
550 | _read_header must survive an OSError (e.g. trying to open a |
| class | TestRelatedRequirements |
564 | _related_requirements -- best-effort REQ-* enrichment, reusing |
| method | TestRelatedRequirements.test_finds_a_req_id_from_a_synthetic_rtm |
568 | |
| method | TestRelatedRequirements.test_returns_empty_when_rtm_is_absent |
582 | |
| method | TestRelatedRequirements.test_returns_empty_when_rtm_is_corrupt |
585 | |
| method | TestRelatedRequirements.test_never_invents_an_id_for_an_unrelated_path |
591 | |
| class | TestNonWaivable |
600 | NON-NEGOTIABLE: no # gate-ok: escape hatch, no downgrade flag. |
| method | TestNonWaivable.test_a_gate_ok_comment_does_not_suppress_a_missing_generator |
603 | |
| method | TestNonWaivable.test_the_module_does_not_import_gate_waivers |
617 | Structural guard: a future edit must not silently wire in the |
| method | TestNonWaivable.test_an_unrecognized_downgrade_flag_is_rejected |
638 | There is no --warn-only / --severity escape hatch: argparse must |
| class | TestLoudReportingAgainstLiveRepo |
645 | The FAIL path leads with a banner naming the LOSS/NEVER-EXISTED |
| method | TestLoudReportingAgainstLiveRepo.test_the_banner_appears_exactly_when_there_is_provenance_loss |
651 | |
| method | TestLoudReportingAgainstLiveRepo.test_json_output_always_carries_loss_and_never_existed_counts |
668 | |
| class | TestRegisteredInBattery |
677 | NON-NEGOTIABLE: registered in BOTH scripts/gates.py and |
| method | TestRegisteredInBattery.test_registered_in_gates_py_as_never_cached |
682 | |
| method | TestRegisteredInBattery.test_registered_in_pre_commit_config_non_waivable |
702 | |
| class | TestAtomicWrites |
719 | A generator must PUBLISH its artifact, never truncate it in place. |
| method | TestAtomicWrites.test_a_literal_path_truncation_is_flagged |
740 | |
| method | TestAtomicWrites.test_an_argparse_bound_destination_is_flagged |
752 | The shape that slipped through a name-based matcher. |
| method | TestAtomicWrites.test_an_atomic_publisher_passes |
772 | |
| method | TestAtomicWrites.test_an_unrelated_output_is_not_flagged |
783 | The false-positive half — 36 of them in one measured run. |
| method | TestAtomicWrites.test_the_live_repo_has_no_truncating_generator |
803 | The regression floor: the real registry, checked as shipped. |