mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Add support for GOCOVERDIR to e2e tests (#1622)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
parent
60a0e82c1f
commit
7d3f5bea9f
@ -245,11 +245,24 @@ func GoBuild(pkgPath, tmpPrefix string) string {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
cmd := exec.Command(
|
||||
"go", "build",
|
||||
args := []string{
|
||||
"go",
|
||||
"build",
|
||||
}
|
||||
|
||||
if len(os.Getenv("GOCOVERDIR")) != 0 {
|
||||
args = append(args,
|
||||
"-cover",
|
||||
"-coverpkg=github.com/opentofu/opentofu/...",
|
||||
)
|
||||
}
|
||||
|
||||
args = append(args,
|
||||
"-o", tmpFilename,
|
||||
pkgPath,
|
||||
)
|
||||
|
||||
cmd := exec.Command(args[0], args[1:]...)
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.Stdout = os.Stdout
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user