Skip to content

Commit aba5db8

Browse files
committed
copy plan files too
1 parent 4cefbeb commit aba5db8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

e2etest/declarativeScenario.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,14 @@ func (s *scenario) Run() {
7878
}
7979
azcopyRan := false
8080
defer func() {
81-
if azcopyRan {
81+
err := os.MkdirAll(os.Getenv("AZCOPY_E2E_LOG_OUTPUT"), os.ModePerm|os.ModeDir)
82+
if err != nil {
83+
s.a.Assert(err, equals(), nil)
84+
return
85+
}
86+
if azcopyRan && s.a.Failed() {
8287
s.uploadLogs(logDir)
83-
s.a.(*testingAsserter).t.Log("uploaded logs for job " + s.state.result.jobID.String() + " to container azcopylogs in account " + os.Getenv("AZCOPY_E2E_ACCOUNT_NAME"))
88+
s.a.(*testingAsserter).t.Log("uploaded logs for job " + s.state.result.jobID.String() + " as an artifact")
8489
}
8590
}()
8691

@@ -143,6 +148,9 @@ func (s *scenario) Run() {
143148
}
144149

145150
func (s *scenario) uploadLogs(logDir string) {
151+
if s.state.result == nil {
152+
return // nothing to upload
153+
}
146154
s.a.Assert(os.Rename(logDir, filepath.Join(os.Getenv("AZCOPY_E2E_LOG_OUTPUT"), s.state.result.jobID.String())), equals(), nil)
147155
}
148156

e2etest/runner.go

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"fmt"
2727
"os"
2828
"os/exec"
29+
"path/filepath"
2930
"strconv"
3031
"strings"
3132

@@ -236,6 +237,7 @@ func (t *TestRunner) ExecuteAzCopyCommand(operation Operation, src, dst string,
236237

237238
if logDir != "" {
238239
env = append(env, "AZCOPY_LOG_LOCATION="+logDir)
240+
env = append(env, "AZCOPY_JOB_PLAN_LOCATION="+filepath.Join(logDir, "plans"))
239241
}
240242

241243
out, err := t.execDebuggableWithOutput(GlobalInputManager{}.GetExecutablePath(), args, env, afterStart, chToStdin)

0 commit comments

Comments
 (0)