Repository navigation
Tests: move seventeen capsule-reading legacy tests to the mirror, expected to fail inside a capsule - #341
Merged
Conversation
…ected to fail inside a capsule Seventeen tests failed in the owner's capsule after the sync with main at cc8f128, and fail the same on a clean checkout of main: thirteen inherit the capsule's mounted launcher settings, where a vendor download is accepted; three read this checkout's live .devcapsule configuration; one walks an ignored directory under the test resources. Each reads a precondition from outside itself, against Unit Tests rule 2. The owner's disposition: mark them expected to fail with the reason "TODO: fix the wrong approach to testing" and move them out of the legacy files so the convention gate keeps holding. Each test leaves its legacy file verbatim, with a one-line docstring naming its cause, for a mirror file under tests/unit/devcapsule/legacy_refactoring/, one per legacy file; the targets are the temporary package devcapsule/legacy_refactoring, eight modules holding nothing but the docstring that says why they exist. The marker holds only inside a capsule, so on the hosted workflow and on a host these remain the tests they were. The one body change is the path to devcapsule-src in test_replaced_scope_word_is_absent, taken from the mirror file's deeper place. Verified in a capsule: nox -s tests green, the checker at 108 legacy files holding 1447 legacy tests, 30 files following the convention, 0 breaches; nox -s typecheck green. The fix of each test against its real unit is queued on the maintenance workstream, the private-home fixture first. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Seventeen tests failed in the owner's capsule after the sync with
mainat cc8f128, and fail the same on a clean checkout ofmain, so no workstream broke them. Each reads a precondition from outside itself, against Unit Tests rule 2:/etc/devcapsule/home/settings.toml, where a vendor download is accepted, becauseprivate_user_directorieshas no hold on that path (six intest_trust.py, three intest_capability_commands_v2.py, one each intest_capability_minimums.py,test_console_channel.py,test_environment_realization.py,test_project_init.py);test_repository_manifest_compatibility.pyread this checkout's live.devcapsule/devcapsule.toml;test_replaced_scope_word_is_absentintest_home.pywalks an ignored.venvunder the sample projects.The owner's disposition
Mark them expected to fail with the reason
TODO: fix the wrong approach to testing, and move them out of the legacy files so the convention gate keeps holding (rule 5 never marks a legacy test expected to fail).Each test leaves its legacy file verbatim, with a one-line docstring naming its cause, for a mirror file under
tests/unit/devcapsule/legacy_refactoring/, one per legacy file because theirprojectfixtures andconfigandsnapshothelpers collide by name. The mirror files import their fixtures and helpers from the legacy modules as the existing mirror files do. The targets are the temporary packagedevcapsule/legacy_refactoring/: eight modules holding nothing but a docstring saying why they exist; each is deleted when its last test is rewritten against its real unit.The marker is
pytest.mark.xfail(IN_CAPSULE, ...),IN_CAPSULEbeing the presence of the launch context file. So the tests are expected to fail only inside a capsule, where they inherit its state; on the hosted workflow and on a host they remain the tests they were, and keep whatever safety they gave.The one change to a body is the path to
devcapsule-srcintest_replaced_scope_word_is_absent, taken from the mirror file's deeper place.Verification
In a capsule:
nox -s testsgreen (2807 passed, 17 xfailed, 4 xpassed); the checker at 108 legacy files holding 1447 legacy tests, 30 files following the convention, 0 breaches;nox -s typecheckgreen. With the capsule condition faked off, the moved tests ran as real tests and only the three that read the owner's uncommitted schema-2 configuration failed.Records
The maintenance status carries the diagnosis and queues the fix: each test rewritten against its real unit, the private-home fixture first, the targets deleted as they empty. The workstream table row matches.
🤖 Generated with Claude Code
Test coverage, from CI run
devcapsule