MCPcopy Index your code
hub / github.com/celer-pkg/celer / TestExecutor_ConfigureOutputs_WithLogFile

Function TestExecutor_ConfigureOutputs_WithLogFile

pkgs/cmd/exec_test.go:151–173  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

149}
150
151func TestExecutor_ConfigureOutputs_WithLogFile(t *testing.T) {
152 tmpDir := t.TempDir()
153 logPath := tmpDir + "/test.log"
154
155 executor := NewExecutor("test", "echo").SetLogPath(logPath)
156 execCmd := exec.Command("echo")
157 execCmd.Env = os.Environ()
158
159 logFile, err := executor.createLogFile(execCmd)
160 if err != nil {
161 t.Fatalf("unexpected error: %v", err)
162 }
163 defer logFile.Close()
164
165 executor.configureOutputs(execCmd, logFile, nil)
166
167 if execCmd.Stdout == nil {
168 t.Error("stdout should not be nil")
169 }
170 if execCmd.Stderr == nil {
171 t.Error("stderr should not be nil")
172 }
173}
174
175func TestExecutor_ComposeWriters_Single(t *testing.T) {
176 executor := NewExecutor("", "")

Callers

nothing calls this directly

Calls 6

NewExecutorFunction · 0.85
SetLogPathMethod · 0.80
createLogFileMethod · 0.80
configureOutputsMethod · 0.80
ErrorMethod · 0.80
CommandMethod · 0.65

Tested by

no test coverage detected