@@ -186,7 +186,7 @@ func (r *Runner) runTestPackage(packageName string) (string, bool, error) {
186186
187187// runCmd runs the user-supplied command once, captures its JSON output,
188188// and returns the temp file path, whether the test passed, and an error if any.
189- func (r * Runner ) runCmd (testCmd []string , runIndex int ) (tempFilePath string , passed bool , err error ) {
189+ func (r * Runner ) runCmd (testCmd []string , runIndex int ) (outputPath string , passed bool , err error ) {
190190 // Create temp file for JSON output
191191 tmpFile , err := os .CreateTemp ("" , fmt .Sprintf ("test-output-cmd-run%d-*.json" , runIndex + 1 ))
192192 if err != nil {
@@ -215,7 +215,7 @@ func (r *Runner) runCmd(testCmd []string, runIndex int) (tempFilePath string, pa
215215
216216 err = cmd .Run ()
217217
218- tempFilePath = tmpFile .Name ()
218+ outputPath = tmpFile .Name ()
219219
220220 // Determine pass/fail from exit code
221221 type exitCoder interface {
@@ -229,7 +229,6 @@ func (r *Runner) runCmd(testCmd []string, runIndex int) (tempFilePath string, pa
229229 return
230230 } else if err != nil {
231231 // Some other error that doesn't implement ExitCode() => real error
232- tempFilePath = ""
233232 err = fmt .Errorf ("error running test command: %w" , err )
234233 return
235234 }
@@ -614,7 +613,6 @@ func (r *Runner) transformTestOutputFiles(filePaths []string) ([]string, error)
614613 }
615614 // Use the transformed file path.
616615 transformedPaths [i ] = outFile .Name ()
617- os .Remove (origPath )
618616 }
619617 return transformedPaths , nil
620618}
0 commit comments