test: prepare

This commit is contained in:
2023-12-09 08:40:07 +00:00
parent d5eb872b13
commit dd66cb9f1e
12 changed files with 221 additions and 35 deletions

View File

@@ -6,21 +6,32 @@ import (
"log"
"os/exec"
"sync"
"github.com/spf13/viper"
)
const (
// DummyPath = "/workspaces/wingmate/cmd/experiment/dummy/dummy"
DummyPath = "/usr/local/bin/wmdummy"
DummyPath = "/usr/local/bin/wmdummy"
EnvDummyPath = "DUMMY_PATH"
EnvPrefix = "WINGMATE"
)
func main() {
var (
stdout io.ReadCloser
stderr io.ReadCloser
wg *sync.WaitGroup
err error
stdout io.ReadCloser
stderr io.ReadCloser
wg *sync.WaitGroup
err error
exePath string
)
cmd := exec.Command(DummyPath)
viper.SetEnvPrefix(EnvPrefix)
viper.BindEnv(EnvDummyPath)
viper.SetDefault(EnvDummyPath, DummyPath)
exePath = viper.GetString(EnvDummyPath)
cmd := exec.Command(exePath)
if stdout, err = cmd.StdoutPipe(); err != nil {
log.Panic(err)