(t *testing.T, args ...string)
| 109 | } |
| 110 | |
| 111 | func runIntegrate(t *testing.T, args ...string) (homeDir string, stderr string, err error) { |
| 112 | t.Helper() |
| 113 | |
| 114 | homeDir = t.TempDir() |
| 115 | if runtime.GOOS == "windows" { |
| 116 | t.Setenv("USERPROFILE", homeDir) |
| 117 | } else { |
| 118 | t.Setenv("HOME", homeDir) |
| 119 | t.Setenv("SHELL", "/bin/bash") |
| 120 | // Pre-create an empty .bashrc; bash.installBinary reads it before |
| 121 | // appending the PATH export line and a missing rc is a hard error. |
| 122 | if err := os.WriteFile(filepath.Join(homeDir, ".bashrc"), nil, 0o644); err != nil { |
| 123 | t.Fatal(err) |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | cmd := &integrateCmd{} |
| 128 | stderr, err = runCommand(t, cmd.Command(configs.NewCeler()), args...) |
| 129 | return homeDir, stderr, err |
| 130 | } |
| 131 | |
| 132 | func integrateArtifacts(homeDir string) []string { |
| 133 | if runtime.GOOS == "windows" { |
no test coverage detected