Repository navigation
test: separate integration runtime discovery from fixture execution - #249
Conversation
## Problem Short integration case codes obscure the checked behavior in test output. The readable-name request covers the complete 133-case deterministic inventory and four related workspace integration tests, not only the initial examples. ## Solution Rename 137 test functions to when_<condition>_then_<expected_outcome>. Preserve case IDs, filenames, platform declarations, assertions, and ignored status. Update exact-name documentation and the test naming example. Separate one documentation paragraph from its preceding list to satisfy harness Clippy. ## Tests Linux workspace all-features tests passed: 1868 unit/bin and 2709 reported integration passes, with the absent credential daemon and partial alias-read coverage explicitly retained. Documentation tests: 13 passed. Deterministic rerun: 124 passed, 9 declared macOS skips, 0 failures/errors. The initial run hit one CN-W-05 host-control Text file busy setup error; unchanged rerun passed. Build, format, Clippy with repository allowances, strict harness Clippy, and credential documentation passed. All 133 renamed deterministic functions were discovered; inverse renaming verifies all test bodies remain unchanged. Native macOS compiled all 133 cases and executed credentials tests on the previous candidate base; its real-daemon case also returned early. Box and credentials also built with default features disabled. The examples command reported no scripted examples; no example behavior was exercised.
|
Important (blocking): Example: Line 78 builds the filters as The Suggestion: Select by module, as the README now recommends. On line 78, use |
|
Assessment: Request Changes The rename is consistent and keeps case IDs, filenames, and assertions. One consumer still uses the old function path to select tests, so it now selects nothing (see the comment about Checks that held
After the one-line filter fix, the PR is ready to merge. |
## Problem The Phase 3 fault-check script constructs module::function filters from case stems. The renamed functions no longer match, so each filter selects no tests. ## Solution Select each stable module path with its trailing double colon. Preserve the fault fixtures, expected refusals, result validation, and test assertions. ## Tests Compiled discovery confirms all eight old filters select zero tests and each replacement selects one intended case. With Python 3.12.16, all three fault selections pass: normal capture, permissive execution, and refused entry. The reducer preserves expected FAIL/ERROR distinctions and RED subset verdicts. The first script run stopped on Python 3.9 lacking tomllib; the interpreter was corrected without changing any fixture or assertion.
|
Assessment: Approve At What I re-verified at 49f7f1b
|
## Problem Native interpreter discovery and tool configuration share one large file with fixture execution. Their platform-specific unit tests make that file harder to extend and review. ## Solution Move runtime discovery and configuration into a private runtime module. Move its thirteen existing unit test functions into runtime/tests.rs. Preserve all fifteen root helper exports and every integration case and platform declaration. The moved implementation and test bodies are unchanged except for indentation and a qualified documentation link. Document the helper boundary and preserve the one-file-per-case extension pattern. ## Tests Thirteen runtime unit functions pass on Linux; twelve pass on macOS, where one Linux-only function is excluded. linux_python_discovery_grants_runtime_libraries_without_the_usr_prefix pins Linux runtime selection. the_probe_config_grants_only_the_runtime_directories_and_declares_the_search_path pins narrow runtime grants. the_git_tool_config_declares_the_real_git_and_claims_nothing_about_lookup pins the tool configuration. Independent source comparison verifies all moved bodies and public root exports. The combined rename and both helper patches pass 124 Linux integration cases with nine declared macOS-only skips. All 133 case records are present; 100 harness library unit tests and sixteen support checks pass. Full workspace tests, all-features build, formatting, repository Clippy, strict harness Clippy, and strict private rustdoc pass. Workspace output retains the missing credential-daemon and partial alias-read diagnostics. The example gate builds successfully but executes zero examples because no scripted examples remain. No new functional coverage is claimed. Native macOS checks cover helper units and compilation; full macOS integration and deployment qualification are separate.
|
Assessment: Approve At Checks that held
|
|
Assessment: Approve At Checks that held at 99385e0
|
d1c37bd
|
Assessment: Approve
Checks that held
|
|
Assessment: Approve
Checks that held
|
Human readable section
Problem: Runtime discovery, workspace setup, and fixture execution share one large integration-harness module. A contributor must navigate unrelated code to change how a test finds an interpreter or its libraries.
Solution: Move runtime discovery and its existing unit tests into a private module. Keep the fifteen public helper exports at the crate root, so existing cases use the same interface. Document the runtime module's responsibility.
Trade-off: This is a code-organization change. It adds no coverage and changes no containment behavior. Existing test names, selectors, assertions, and platform restrictions remain unchanged. Concurrent cleanup and shared scenario helpers came from the separate #256, now on main.
Description
The runtime module owns native interpreter discovery and the runtime library grants used by integration fixtures. Its public exports remain eleven functions, two types, and two constants. Thirteen existing unit-test functions move beside this implementation; all thirteen apply on Linux, and twelve apply on macOS because one checks Linux-specific host discovery.
The diff against merged main contains four files:
lib.rs,runtime.rs,runtime/tests.rs, and the harness README. It retains main's tool-copy helper and updates the moved configuration test to use main's separate tool directory.The final diff contains no bulk test renames, selector changes, Box tests, credential tests, or policy changes. Existing test names remain. Naming improvements should accompany a substantive case change when an existing name is unclear. This PR replaces the standalone runtime-extraction proposal in #257 and preserves its implementation.
Related Issues
Continues the integration-maintenance work from #187. Supersedes #257. Cleanup and shared move-scenario helpers came from #256, now on main.
Type of Change
Other: Runtime-helper organization and matching documentation.
Testing
Current main refresh at
b233dbeHead
b233dbebcd4f457bb9c5d66a59338bbf7019e3bbmergesmainat67e378ae16f2a8457a6b856228343086f404e743, including #288's metadata repair and Linux test compilation fix. The merge required no conflict edits.The complete four-file diff against current main is byte-identical to the previously reviewed diff. Independent review verified the preserved helpers, tests, exports, and documentation in tree
d9a5878e4e919bc64a236951a7d75691b361cf7e.Cargo.lockis unchanged.Standalone harness formatting and scoped whitespace checks passed. No local build or runtime suite was repeated for this merge of unchanged PR content.
Current-head CI Gate passed. Linux ARM64 passed 131 integration cases with nine declared platform skips; macOS passed 128 with twelve platform skips. Each platform recorded all 140 cases, with zero failures or setup errors and Cargo exit zero. The previously failing metadata query case (
SH-PROBE-PERMISSION) passed on both platforms.The same jobs passed all 104 Linux and 103 macOS harness library tests, with zero ignored or filtered tests. GitHub tested merge
2005e52bb4f77db6a979a05201fcba3c7c2548cc; its tree exactly matches the reviewed source above.The workspace Rust, site-manifest, separate Verdict, and native-filesystem jobs were skipped by changed-path filters. This is fresh harness and integration evidence, not a new full-workspace run. Rust CodeQL analysis also passed at this head.
Automated review at
b233dbereported an Approve assessment, independently passed strict harness Clippy and the 13 runtime unit tests, and found no new issue. It does not replace formal human approval.The previous head's Linux and macOS metadata failures occurred before #288 merged. Retrying that old run did not import the repair. The new run above supplies current integration evidence. The earlier approvals were dismissed; renewed human approval remains required. Squash auto-merge is enabled.
Earlier conflict repair at
d1c37bdHead
d1c37bd19d3582778b0ce875bdbc939f25bb4695merges maine95d0c808f33d05afb246415fb9b57cf35cb0078. The reviewed source tree isc1db9f5ae22ae9dab8636e5ca8a219f753b28ca1.Local checks ran on this frozen merged tree before the merge commit was created. The committed tree is identical.
The resolution retains the extracted runtime module and main's private
install_toolhelper. The moved configuration test uses/b/tools/built-hello, matching main.The thirteen moved tests and their two test helpers match main after formatting. The runtime implementation differs from main only in a qualified rustdoc link.
Independent review confirmed the preserved exports, helper implementation, test bodies, and documentation.
test-supportpassed. Strict all-target/all-feature harness Clippy passed with-D warningsand no command-line allowances.strands-boxwas absent fromPATH. Building Box and placing its binaries first onPATHcorrected setup; no assertion changed. The initial failure log remains preserved.coverage_gate=full; runner exit zero in 240.48 seconds. Exclusions remain unexecuted assertions.Local execution used Amazon Linux 2023 ARM64, Rust/Cargo 1.98.1, four build jobs, and four test threads.
EXPERIMENTAL_LINUX_SUPPORT=TRUEwas set.Box and its trampoline used fresh debug binaries. The deterministic harness used release binaries and separate absolute build and result directories.
Shared fixture access was coordinated; a final process check found no remaining fixture consumers.
Commands ran from the repository checkout with those environment settings:
Earlier hosted validation failed. CI Gate failed. Both deterministic jobs failed the shared metadata-budget test (
SH-PROBE-PERMISSION).Both jobs checked out merge
b327f0ad26616c8a80a90e076161f5da0ab25b51, combining this head with newer main917e71d010243f4a6ed72533ceb5d7047494f50ffrom #268.That integration contains 137 cases. The local 133-case result above covers the separately stated
e95d0c8merge tree.Both verdicts are RED, with zero setup errors and Cargo exit 101. The test expects
PY=Falseafter a permission-refused metadata query.Both platforms instead report
PermissionError: .../locked/f.txt: cannot be resolved to a path this box acts on. The subsequent file read succeeds (keptCAT=0), so the expected metadata-budget refusal is not observed.The failing file,
test-integ/tests/shell/sh_probe_permission.rs, was introduced by #268 and is absent from authored headd1c37bd.Its blob
dc88afb4bc96bcdf65388985b4dcf0aa6d4f2e2bis identical in newer main and the hosted merge. No retry or source change has been made for this failure.This failed result remains preserved. The current refresh above includes the shared repair and starts a new integration run.
The changed-path filters skipped Rust, Site manifest, Verdict, and Native Filesystem jobs. Separate Rust CodeQL analysis passed.
Automated review. The current-head assessment is Approve, for
d1c37bdcompared withe95d0c8.It confirms the preserved extraction, exports, lint, and documentation. It separately reports 101 helper passes and three failures also seen on main on its host.
Our built-binary and corrected-
PATHinvocation passed all 104 helpers, as recorded above. The automated assessment does not clear the newer-main CI failure.At Kevin's request, Codex reviewed this conflict resolution and recorded its validation.
The prior formal approval at
beb0389was dismissed after this push. A new formal maintainer approval remains required. Squash auto-merge remains enabled.Historical validation before the main merge
The following evidence covers tree
9a19007bf36c8af10ce627d1a34cc541a72e5680and its stated earlier revisions. It does not cover the current merged tree.The nine Linux skips remain
CN-D-01,CN-D-02,CN-E-04,CN-F-02,CN-F-03,CN-I-13,CN-L-01,CN-P-02, andCN-T-05. They are actual test cases declared for macOS. Linux-specific cases check different boundaries. Test-gate enforcement from #185 is unchanged; deployment qualification remains separate.Earlier exact source. Base
e4ca8b80359b2213d684de31cd6ef32e0d61478a; published headbeb038964d485bbef3e0664ca8f7621efddce8e2; tree9a19007bf36c8af10ce627d1a34cc541a72e5680. That earlier commit removed the naming changes without rewriting reviewed history.This complete tree is byte-identical to runtime head
2ebeeade92a82598e0034a670403b15e90904aefand hosted test merge3c4114302277385b07b355d443e384ee3c258875. The GitHub merge-commit object and local tree comparison both confirm that identity. The full-suite results below therefore cover the same source. That earlier head obtained a passing hosted CI Gate, with rerun evidence below. Formal GitHub approval remains required._ctypeswithout a shared-library file, so the existing host-discovery assertion found no extension directory. Independent probes confirmed the environment difference; the identical test binary passed with system Python. No assertion changed.box_librarytarget emits no count and is excluded. Documentation: 13 passed, one ignored. This earlier run covers unchanged workspace sources; it was not rerun for this standalone-harness change.beb0389beb0389. Linux recorded 124 passes, nine declared platform skips, and all 133 cases, with zero failures/errors. The retained macOS result from attempt 2 recorded 121 passes, twelve platform skips, and all 133 cases. Rust, native-filesystem, and Verdict jobs were skipped by changed-path filters; this was not a new workspace-suite execution. Formal GitHub approval remains required.Hosted rerun evidence. Both reruns checked out merge
98c892f403b9d399d44b274e50d21ddbc7d15cf1, combining published headbeb038964d485bbef3e0664ca8f7621efddce8e2with basee4ca8b80359b2213d684de31cd6ef32e0d61478a. They did not test a newermainrevision. Attempt 2's Linux job recorded 123 passes, nine platform skips, and one error.CN-W-05encounteredExecutableFileBusy(Text file busy) while executing its host control outside Box, before its containment assertions. One failed-job retry passed without source changes. Attempt 3's Linux job recordsCN-W-05as PASS.The unchanged case checks allowed Git and hook execution, plus refusals for read-only writes, an ungranted program, and protected configuration reads. It also checks refusal of agent hook execution and undeclared Git. The earlier error's cause remains unresolved; the retry is not a source fix.
The initial status query did not expose CI Gate. A later complete check query returned the original successful Gate, the failed attempt-2 Gate, and the successful attempt-3 Gate. This evidence does not establish that the original Gate never existed or explain its earlier absence from the query.
The raw deterministic verdict records
box_commit: unknown; verified Git trees, checkout logs, and build receipts identify its source. Successful Cargo wrappers for platform-inapplicable cases are reported as skips in the integration verdict.Earlier Linux environment. Those targeted checks use Amazon Linux
2023.12.20261102as reported by/etc/os-release, AArch64, kernel6.12.113-138.209.amzn2023.aarch64, Rust/Cargo 1.98.1,EXPERIMENTAL_LINUX_SUPPORT=TRUE, andCARGO_BUILD_JOBS=2. The built Box binaries precede the host defaults onPATH; runtime discovery uses the original system Python selection. Python 3.12.16 is first only during fault-script execution, which needstomllib.HOMEis unchanged. The standalone harness uses an absolute sharedCARGO_TARGET_DIR. Hosted platforms were Ubuntu 24.04 ARM and macOS latest. Earlier native macOS helper validation used Darwin 27.2 ARM64.Earlier targeted commands, from that candidate checkout:
Earlier applicable gates and full-suite commands:
justwas absent on the local Linux host, so its relevant gates ran through the direct commands above. The existing Linux execution reporter retained exactly the missing-daemon and partial alias-read omissions. The identical-tree hosted workspace Rust and native-filesystem jobs were skipped by changed-path filters; the earlier local workspace evidence remains separate.just check, orcargo test --workspace --all-features); exact-source and earlier unchanged-workspace boundaries are stated above.Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.