Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ops/platform-acceptance/windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ function Assert-DistroVersion([string] $ExpectedVersion) {
# which ended the PowerShell string and executed `systemctl` on Windows.
# Substitute only the already-validated semver after constructing the exact
# bash command, so every service/version assertion really runs inside WSL.
# 1Helm bundles its own Node at the installed /opt/1helm/node-current
# contract path; there is no global `node` on the distro PATH, so invoke
# the bundled binary by absolute path.
$command = @'
test "$(systemctl is-active 1helm.service)" = active
test "$(node -p 'require("/opt/1helm/current/package.json").version')" = '__EXPECTED__'
test "$(/opt/1helm/node-current/bin/node -p 'require("/opt/1helm/current/package.json").version')" = '__EXPECTED__'
'@
Invoke-Distro ($command.Replace('__EXPECTED__', $ExpectedVersion))
}
Expand Down
1 change: 1 addition & 0 deletions test/phase4-platform-acceptance.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ test("Windows code publishes no artifact/signing claim and requires honest reboo
assert.match(windows, /apply-linux-release\.sh/);
assert.match(windows, /function Assert-DistroVersion/);
assert.equal((windows.match(/Assert-DistroVersion \$(?:Version|PreviousVersion)/g) || []).length, 4);
assert.match(windows, /\/opt\/1helm\/node-current\/bin\/node/);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Match the version-probe command, not only the path text.

Line 215 can match the path in ops/platform-acceptance/windows.ps1 Lines 55-57, even if the executable on Line 60 reverts to bare node. Match test "$(/opt/1helm/node-current/bin/node -p or also assert that the version probe does not use bare node.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/phase4-platform-acceptance.mjs` at line 215, Update the assertion in the
phase 4 platform acceptance test to match the actual version-probe command,
including execution of /opt/1helm/node-current/bin/node with the -p argument,
rather than only matching the path text. Ensure the test cannot pass when the
probe uses bare node, either by asserting the complete command or explicitly
rejecting the bare-node form.

assert.match(windows, /UTF8Encoding\(\$false\)/);
assert.match(windows, /\[IO\.File\]::WriteAllText/);
assert.match(windows, /\/bin\/bash -lc "bash '\$scriptInDistro'"/);
Expand Down
Loading