add section for failed log uploads
@@ -237,11 +237,13 @@ def clone_git_repository(git_repository, platform):
fail_if_nonzero(execute_command(["git", "clone", git_repository, clone_path]))
os.chdir(clone_path)
+
def cleanup(bazel_binary):
if os.path.exists("WORKSPACE"):
print("\n--- Cleanup")
fail_if_nonzero(execute_command([bazel_binary, "clean", "--expunge"]))
+
def execute_shell_commands(commands):
if not commands:
return
@@ -283,7 +285,10 @@ def fail_if_nonzero(exitcode):
def upload_failed_test_logs(bep_file, tmpdir):
if not os.path.exists(bep_file):
return
- for logfile in failed_logs_from_bep(bep_file, tmpdir):
+ logfiles = failed_logs_from_bep(bep_file, tmpdir)
+ if logfiles:
+ print("\n--- Uploading failed test logs")
+ for logfile in logfiles:
fail_if_nonzero(execute_command(["buildkite-agent", "artifact", "upload",
logfile]))
