mirror of
https://github.com/docker/compose.git
synced 2026-10-20 19:02:47 +00:00
use go 1.20 -cover support
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
6a0398d786
commit
85ddfde5d6
6 changed files with 35 additions and 7 deletions
|
|
@ -214,12 +214,19 @@ func CopyFile(t testing.TB, sourceFile string, destinationFile string) {
|
|||
// BaseEnvironment provides the minimal environment variables used across all
|
||||
// Docker / Compose commands.
|
||||
func (c *CLI) BaseEnvironment() []string {
|
||||
return []string{
|
||||
env := []string{
|
||||
"HOME=" + c.HomeDir,
|
||||
"USER=" + os.Getenv("USER"),
|
||||
"DOCKER_CONFIG=" + c.ConfigDir,
|
||||
"KUBECONFIG=invalid",
|
||||
}
|
||||
if coverdir, ok := os.LookupEnv("GOCOVERDIR"); ok {
|
||||
_, filename, _, _ := runtime.Caller(0)
|
||||
root := filepath.Join(filepath.Dir(filename), "..", "..")
|
||||
coverdir = filepath.Join(root, coverdir)
|
||||
env = append(env, fmt.Sprintf("GOCOVERDIR=%s", coverdir))
|
||||
}
|
||||
return env
|
||||
}
|
||||
|
||||
// NewCmd creates a cmd object configured with the test environment set
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue