feat: add support for agentsock on Windows (#22171)
relates to #21335 Adds support for the agentsock and thus `coder exp sync` commands on Windows. This support was initially missing.
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
package testutil
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -37,3 +40,10 @@ func TempDirUnixSocket(t *testing.T) string {
|
||||
})
|
||||
return dir
|
||||
}
|
||||
|
||||
func AgentSocketPath(t *testing.T) string {
|
||||
if runtime.GOOS == "windows" {
|
||||
return fmt.Sprintf(`\\.\pipe\com.coder.agentsocket_test.%s.%s`, t.Name(), rand.Text())
|
||||
}
|
||||
return filepath.Join(TempDirUnixSocket(t), "test.sock")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user