fix(terminal): compile Linux tpgid tests under pty - #687
Open
Raymond8196 wants to merge 1 commit into
Open
Conversation
Pre-commit hook ran. Total eslint: 0, total circular: 0
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.
Problem
On Linux,
cargo test --workspace --no-runand Clippy with all targets fail before running tests with E0432:shells_tests.rsimportsparse_tpgid_from_statfrom the wrong module.shells.rsmounts that file aspty_commands::shells::tests, so the nested Linux test module resolvessuper::supertopty_commands::shells. The private helper actually belongs to the siblingpty_commands::ptymodule, making the test target uncompilable on Linux.Solution
Move the three Linux
parse_tpgid_from_stattests into the existingpty.rstest module.The tests are now descendants of the module that owns the private helper, so they can exercise it without widening production visibility. Runtime code and behavior are unchanged.
Potential risks
The runtime risk is low because this changes only test placement and test names. Any external test filtering that referenced the old fully qualified test paths would need to use the new
pty_commands::pty::tests::parse_tpgid_testspaths.This PR does not clean the separate pre-existing Linux warnings or add Linux CI coverage. It was verified on Linux x86_64; macOS and Windows test execution was not repeated because the moved tests remain Linux-gated.
Verification
cargo test -p terminal parse_tpgid— passed: 3 passed, 0 failed.cargo test --workspace --no-run— passed and generated every workspace test executable; the previous E0432 is gone.cargo clippy -p terminal --all-targets— exited successfully; the separate pre-existingget_process_name_pswarning remains.rustfmt --edition 2021 --check src-tauri/crates/terminal/src/pty_commands/pty.rs src-tauri/crates/terminal/src/pty_commands/tests/shells_tests.rs— passed.git diff --check origin/develop...HEAD— passed.terminal— passed.The full
cargo test --workspacesuite was not executed; the workspace test targets were compiled with--no-run, and the three affected tests were executed directly.UI evidence
Not applicable: this PR changes only Rust test ownership and has no user-visible UI behavior.