no ticket: Show go compile output for embedded unit test plugins (#11689)
Hmm, by the time I looked again the test is passing.
Этот коммит содержится в:
@@ -4,6 +4,7 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
@@ -50,10 +51,14 @@ func CompileGo(t *testing.T, sourceCode, outputPath string) {
|
|||||||
goMod(t, dir, "edit", "-replace", fmt.Sprintf("github.com/mattermost/mattermost-server@v0.0.0=%s", mattermostServerPath))
|
goMod(t, dir, "edit", "-replace", fmt.Sprintf("github.com/mattermost/mattermost-server@v0.0.0=%s", mattermostServerPath))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out := &bytes.Buffer{}
|
||||||
cmd := exec.Command("go", "build", "-o", outputPath, "main.go")
|
cmd := exec.Command("go", "build", "-o", outputPath, "main.go")
|
||||||
cmd.Dir = dir
|
cmd.Dir = dir
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = out
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = out
|
||||||
err = cmd.Run()
|
err = cmd.Run()
|
||||||
|
if err != nil {
|
||||||
|
t.Log("Go compile errors:\n", out.String())
|
||||||
|
}
|
||||||
require.NoError(t, err, "failed to compile go")
|
require.NoError(t, err, "failed to compile go")
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user