make sure godog package is installed before compilation of test package
Этот коммит содержится в:
родитель
4b6e3ea343
коммит
8272a307cf
1 изменённых файлов: 9 добавлений и 2 удалений
11
builder.go
11
builder.go
|
@ -116,7 +116,14 @@ func Build() (string, error) {
|
||||||
return bin, err
|
return bin, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// @TODO: may be a case that godog dependency is not installed. may need to install it
|
// make sure godog package archive is installed, gherkin is not necessary at this point
|
||||||
|
cmd := exec.Command("go", "install", godogPkg.ImportPath)
|
||||||
|
cmd.Env = os.Environ()
|
||||||
|
out, err = cmd.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
return bin, fmt.Errorf("failed to install godog package:\n%s", string(out))
|
||||||
|
}
|
||||||
|
|
||||||
pkgDir := filepath.Join(godogPkg.PkgRoot, build.Default.GOOS+"_"+build.Default.GOARCH)
|
pkgDir := filepath.Join(godogPkg.PkgRoot, build.Default.GOOS+"_"+build.Default.GOARCH)
|
||||||
pkgDirs := []string{testdir, workdir, pkgDir}
|
pkgDirs := []string{testdir, workdir, pkgDir}
|
||||||
|
|
||||||
|
@ -138,7 +145,7 @@ func Build() (string, error) {
|
||||||
args = append(args, "-I", inc)
|
args = append(args, "-I", inc)
|
||||||
}
|
}
|
||||||
args = append(args, "-pack", testmain)
|
args = append(args, "-pack", testmain)
|
||||||
cmd := exec.Command("go", args...)
|
cmd = exec.Command("go", args...)
|
||||||
cmd.Env = os.Environ()
|
cmd.Env = os.Environ()
|
||||||
out, err = cmd.CombinedOutput()
|
out, err = cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче