mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-19 11:31:03 +00:00
* feat(openclaw): add gateway image inspection * feat(openclaw): pull gateway image from registry * refactor(vm): decouple readiness from image cache * refactor(openclaw): remove vm cache from runtime factory * feat(openclaw): detect current gateway image * feat(openclaw): prewarm vm runtime and reuse current gateway * feat(openclaw): prewarm runtime on server startup * refactor(vm): remove browseros image cache runtime * refactor(build-tools): remove openclaw tarball pipeline * chore: self-review fixes * fix(openclaw): suppress prewarm pull progress logs * fix(openclaw): address review feedback * fix(openclaw): resolve review findings * fix(dev): stop stale watch supervisors
39 lines
867 B
Go
39 lines
867 B
Go
package cmd
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestEnsureLimactlPresentMissingMessage(t *testing.T) {
|
|
t.Setenv("PATH", t.TempDir())
|
|
|
|
err := ensureLimactlPresent()
|
|
if err == nil {
|
|
t.Fatal("expected missing Lima error")
|
|
}
|
|
|
|
msg := err.Error()
|
|
if !strings.Contains(msg, "Lima is not installed.") {
|
|
t.Fatalf("expected missing Lima message, got %q", msg)
|
|
}
|
|
if !strings.Contains(msg, "brew install lima") {
|
|
t.Fatalf("expected brew install hint, got %q", msg)
|
|
}
|
|
}
|
|
|
|
func TestEnsureLimactlPresentFindsPathBinary(t *testing.T) {
|
|
binDir := t.TempDir()
|
|
limactlPath := filepath.Join(binDir, "limactl")
|
|
if err := os.WriteFile(limactlPath, []byte("#!/bin/sh\n"), 0o755); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Setenv("PATH", binDir)
|
|
|
|
if err := ensureLimactlPresent(); err != nil {
|
|
t.Fatalf("expected limactl to resolve, got %v", err)
|
|
}
|
|
}
|