MCPcopy
hub / github.com/mudler/LocalAI / startServer

Function startServer

backend/go/vibevoice-cpp/vibevoicecpp_test.go:53–67  ·  view source on GitHub ↗

startServer launches the prebuilt backend binary and returns a running *exec.Cmd. test.sh ensures `./vibevoice-cpp` is built; if it isn't, every gRPC spec is skipped with a clear reason.

()

Source from the content-addressed store, hash-verified

51// running *exec.Cmd. test.sh ensures `./vibevoice-cpp` is built; if
52// it isn't, every gRPC spec is skipped with a clear reason.
53func startServer() *exec.Cmd {
54 binary := os.Getenv("VIBEVOICE_BINARY")
55 if binary == "" {
56 binary = "./vibevoice-cpp"
57 }
58 if _, err := os.Stat(binary); os.IsNotExist(err) {
59 Skip("backend binary not found at " + binary)
60 }
61 cmd := exec.Command(binary, "--addr", testAddr)
62 cmd.Stdout = os.Stderr
63 cmd.Stderr = os.Stderr
64 Expect(cmd.Start()).To(Succeed())
65 time.Sleep(startupWait)
66 return cmd
67}
68
69func stopServer(cmd *exec.Cmd) {
70 if cmd == nil || cmd.Process == nil {

Callers 1

Calls 1

StartMethod · 0.65

Tested by

no test coverage detected