Repository navigation
Studio: test the Windows launcher shape, not just the path normalizer - #7969
Merged
Merged
Conversation
The windows-unit-tests leg added in #7943 pins powershell_script_path as a pure function. That cannot see the regression that actually shipped: #7819's entire install.rs diff was Bypass -> RemoteSigned, and dropping the powershell_script_path call from spawn_script leaves every existing assertion passing while first-run install is broken on every Windows bundle. Lift the argument vector into powershell_launch_args so the call site itself is testable, then run the real interpreter with those flags against a script addressed the way Tauri addresses it (fs::canonicalize, which resource resolution bottoms out in and which is documented to return extended-length syntax). The test asserts it reproduced a verbatim path before using it, so it cannot pass vacuously. A second test pins the flag set so a policy swap shows up as a diff. No behaviour change: the arguments spawn_script passes are byte for byte the ones it passed before.
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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 is wrong
#7943 fixed the verbatim-path authorization failure and added a
windows-unit-testsleg tostudio-tauri-smoke.ymlto keep it fixed. That leg runs, but the two tests it guards with are assertions overpowershell_script_pathas a pure function, and the regression that actually shipped is invisible to them.#7819's entire
install.rsdiff wasBypass->RemoteSigned. It never touched a path. So the failure mode is a change to the flags interacting with a path spelling that was already there, and neither a normalizer unit test nor any Linux job can see it.Two mutations reintroduce a broken first-run install on every Windows bundle while leaving all of #7943's assertions green:
powershell_script_path(script)call fromspawn_scriptand passscriptrawThe fix
Lift the argument vector out of
spawn_scriptintopowershell_launch_args, so the call site is a value a test can look at rather than something built inline and immediately spawned. Then two tests:powershell_runs_a_script_addressed_the_way_tauri_addresses_itruns the realpowershell.exe, with the real flags, against a path fromfs::canonicalize, which is whatresolve(Resource)bottoms out in and which Rust documents as returning extended-length syntax. It asserts it actually got a\\?\path before using it, so it cannot pass vacuously ifcanonicalizeever stops emitting one. A temp script has noZone.Identifier, soRemoteSignedadmits it unsigned; the path spelling and the flag set are what is under test, not signing.powershell_launch_args_pin_the_defender_friendly_shapepins the flag vector, so a policy swap shows up as a diff rather than as silence, and asserts-WindowStyle/Bypassdo not come back.No behaviour change. The arguments
spawn_scriptpasses are byte for byte the ones it passed before.Verification
Both legs of
studio-tauri-smoke.ymlon a disposable staging runner, since the Windows-only code is exactly what no local Linux build compiles:The negative control is the part worth reading. It drops
powershell_script_pathfrom the call site, the mutation no existing test can see, and the new test reproduces the exact reported failure inside CI:Both
powershell_script_path_*tests passed on that mutated tree, which is the gap this closes. The only two failures are the two tests added here.Note
This is test coverage only, so it does not help anyone currently stuck.
desktop-v0.1.521-betatargetsa6ad2152, which predates #7943's merge by about four and a half hours, so all three current Windows betas (0.1.512,0.1.52,0.1.521) still fail on first run withAuthorizationManager check failed. A build cut from currentmainis the actual fix for users.