From 68603d9fea217a0d9541454b516e1a2a67e95060 Mon Sep 17 00:00:00 2001 From: Adele Reed Date: Mon, 19 Sep 2022 13:13:22 -0700 Subject: [PATCH] copy plan files too --- e2etest/declarativeScenario.go | 4 ++++ e2etest/runner.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/e2etest/declarativeScenario.go b/e2etest/declarativeScenario.go index e939a4a764..6217113b96 100644 --- a/e2etest/declarativeScenario.go +++ b/e2etest/declarativeScenario.go @@ -78,6 +78,7 @@ func (s *scenario) Run() { } azcopyRan := false defer func() { + os.MkdirAll(os.Getenv("AZCOPY_E2E_LOG_OUTPUT"), os.ModePerm|os.ModeDir) if azcopyRan { s.uploadLogs(logDir) 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")) @@ -143,6 +144,9 @@ func (s *scenario) Run() { } func (s *scenario) uploadLogs(logDir string) { + if s.state.result == nil { + return // nothing to upload + } s.a.Assert(os.Rename(logDir, filepath.Join(os.Getenv("AZCOPY_E2E_LOG_OUTPUT"), s.state.result.jobID.String())), equals(), nil) } diff --git a/e2etest/runner.go b/e2etest/runner.go index d4c54d83b9..a5f5d1e22f 100644 --- a/e2etest/runner.go +++ b/e2etest/runner.go @@ -26,6 +26,7 @@ import ( "fmt" "os" "os/exec" + "path/filepath" "strconv" "strings" @@ -236,6 +237,7 @@ func (t *TestRunner) ExecuteAzCopyCommand(operation Operation, src, dst string, if logDir != "" { env = append(env, "AZCOPY_LOG_LOCATION="+logDir) + env = append(env, "AZCOPY_JOB_PLAN_LOCATION="+filepath.Join(logDir, "plans")) } out, err := t.execDebuggableWithOutput(GlobalInputManager{}.GetExecutablePath(), args, env, afterStart, chToStdin)