Skip to content

Commit 7b6eb9e

Browse files
shuyama1akshat-jindal-nit
authored andcommitted
Rename VCR re-replaying test logs to prevent overwriting replaying logs (GoogleCloudPlatform#12168)
1 parent 903b690 commit 7b6eb9e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.ci/magician/vcr/tester.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -462,23 +462,23 @@ func (vt *Tester) UploadLogs(opts UploadLogsOptions) error {
462462
if !ok {
463463
return fmt.Errorf("no log path found for mode %s and version %s", opts.Mode.Lower(), opts.Version)
464464
}
465+
var suffix string
466+
if opts.AfterRecording {
467+
suffix = "_after_recording"
468+
}
465469
args := []string{
466470
"-h",
467471
"Content-Type:text/plain",
468472
"-q",
469473
"cp",
470474
"-r",
471475
filepath.Join(vt.baseDir, "testlogs", fmt.Sprintf("%s_test.log", opts.Mode.Lower())),
472-
bucketPath + "build-log/",
476+
fmt.Sprintf("%sbuild-log/%s_test%s.log", bucketPath, opts.Mode.Lower(), suffix),
473477
}
474478
fmt.Println("Uploading build log:\n", "gsutil", strings.Join(args, " "))
475479
if _, err := vt.rnr.Run("gsutil", args, nil); err != nil {
476480
fmt.Println("Error uploading build log: ", err)
477481
}
478-
var suffix string
479-
if opts.AfterRecording {
480-
suffix = "_after_recording"
481-
}
482482
if opts.Parallel {
483483
args := []string{
484484
"-h",

0 commit comments

Comments
 (0)