Skip to content

Commit 50668b0

Browse files
committed
fix: use rustup for checking installed wasm32 target in tests
The previous fix (04a8b11) incorrectly used `rustc --print target-list` which shows ALL SUPPORTED targets (hundreds), not INSTALLED targets. This caused false positives: tests thought Rust was available, but server correctly rejected compilation when wasm32 target wasn't installed. Now using `rustup target list --installed` to match server's detection logic in rust.go:52. Fixes: - TestE2E_ScriptingAPI_ResponseModification - TestE2E_ScriptingAPI_BothTriggers - TestE2E_ScriptValidation/Valid_Rust
1 parent 04a8b11 commit 50668b0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

internal/e2e/scripting_compilation_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,14 @@ func isRustAvailable() bool {
620620
return false
621621
}
622622

623-
// Check if wasm32-unknown-unknown target is installed
624-
cmd := exec.Command("rustc", "--print", "target-list")
623+
// Check if rustup exists (needed to query installed targets)
624+
if cmd := exec.Command("rustup", "--version"); cmd.Run() != nil {
625+
return false
626+
}
627+
628+
// Check if wasm32-unknown-unknown target is INSTALLED (not just supported)
629+
// This matches the server's detection logic in rust.go:52
630+
cmd := exec.Command("rustup", "target", "list", "--installed")
625631
out, err := cmd.Output()
626632
if err != nil {
627633
return false

0 commit comments

Comments
 (0)