Skip to content

test(install): take Write-OvisCommand whole after it gained a -Core switch - #5037

Merged
devswha merged 1 commit into
mainfrom
fix/launcher-test-write-ovis-command
Nov 29, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/launcher-test-write-ovis-command

Conversation

@devswha

@devswha devswha commented Nov 29, 2026

Copy link
Copy Markdown
Owner

Change

#5030 changed the header of Write-OvisCommand in install.ps1 to function Write-OvisCommand([switch]$Core) {. scripts/install.astra-launcher.test.ts cut the function out of install.ps1 by its old header, so the slice started at -1 and PowerShell never saw the function:

The term 'Write-OvisCommand' is not recognized as a name of a cmdlet, function, script file, or executable program.
(fail) writes a usable Windows shim under a non-ASCII user path

main stays green because its self-hosted runner has no pwsh and skips these two tests. Every run on a GitHub-hosted runner, which has pwsh, fails Fast checks, so fork pull requests (#5016, #5017, #5021) are all red on this one test.

The test now takes the function from its header to its own closing brace. Ending at $newInstall = as before would, since #5030, also take in code that needs USERPROFILE.

Validation

With PowerShell 7.7.0 unpacked where the test looks for it ($TMPDIR/launcher-pwsh/pwsh):

  • main: 1 pass, 1 fail (the error above).
  • this branch: 2 pass, 0 fail.
  • scripts/conventions.test.ts: 59 pass.

…witch

#5030 changed the function's header to 'function Write-OvisCommand([switch]$Core) {', so the test's slice started at -1 and pwsh never saw the function. Every GitHub-hosted run with pwsh (fork PRs) failed Fast checks; main's self-hosted runner has no pwsh and skips the test. The slice now ends at the function's own closing brace instead of '$newInstall =', which since #5030 also takes in code that needs USERPROFILE.
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Updated a test to match the current command declaration format and correctly identify the end of the function.

The test now locates Write-OvisCommand using its declaration syntax and extracts the function through its closing brace.

Changes: Installer test

Layer / File(s) Summary
Update function extraction
scripts/install.astra-launcher.test.ts
The test searches for function Write-OvisCommand( and extracts through the function’s closing brace.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: Minimal · up to 32fd0

This updates an installer test so it extracts the current Write-OvisCommand function correctly. It does not change production behavior, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the test now extracts the whole Write-OvisCommand function after it gained a -Core switch. It is specific, ten words, and matches the changeset.
Description check Passed The description follows the template. It has a Change section that explains the cause (#5030 changed the function header, so the old slice started at -1), the resulting behavior, and the fix. It has a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description follows the template. It has a Change section that explains the cause (#5030 changed the function header, so the old slice started at -1), the resulting behavior, and the fix. It has a Validation section listing the commands run (main vs. branch results, and scripts/conventions.test.ts) with outcomes. It does not mention the fast/full check commands from the template or changelog.d entry, and it does not mention contract-test coverage. Those omissions are minor because the change is test-only.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 995ad9d and 32fd0b5.

Files selected for processing: 1

  • scripts/install.astra-launcher.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@devswha
devswha merged commit c48f4b8 into main Nov 29, 2026
13 checks passed
@devswha

devswha commented Nov 29, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head 32fd0b52b. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit reviewed this head.

Test-only fix for main's #5030 breaking scripts/install.astra-launcher.test.ts on runners with pwsh (all fork PR Fast checks). Verified with PowerShell 7.7.0: fails on main, passes here.

@devswha
devswha deleted the fix/launcher-test-write-ovis-command branch November 29, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant