From 296902df0ed0e74fddf7ae6848994c74b10a894a Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Fri, 22 Nov 2024 16:04:30 +0100 Subject: [PATCH] Upload test logs with a UTF-8 content type This fixes rendering of test `.log` files when opened in a browser. Updating the deps was required to get the project to compile due to: ``` error[E0635]: unknown feature `proc_macro_span_shrink` --> /Users/fmeum/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.56/src/lib.rs:92:30 | 92 | feature(proc_macro_span, proc_macro_span_shrink) | ^^^^^^^^^^^^^^^^^^^^^^ ``` Update command: ``` cargo update proc-macro2 --precise 1.0.60 ``` --- agent/Cargo.lock | 6 +++--- agent/src/artifact/upload.rs | 36 ++++++++++++++++++++++++---------- agent/tests/artifact/upload.rs | 4 ++-- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/agent/Cargo.lock b/agent/Cargo.lock index 2ef353eb0d..95717f406f 100644 --- a/agent/Cargo.lock +++ b/agent/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -690,9 +690,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] diff --git a/agent/src/artifact/upload.rs b/agent/src/artifact/upload.rs index ec774cfffc..442999430f 100644 --- a/agent/src/artifact/upload.rs +++ b/agent/src/artifact/upload.rs @@ -210,7 +210,13 @@ fn upload_bep_json_file( build_event_json_file: &Path, mode: Mode, ) -> Result<()> { - uploader.upload_artifact(dry, None, build_event_json_file, mode) + uploader.upload_artifact( + dry, + None, + build_event_json_file, + mode, + None, + ) } fn gen_error_content(bazelci_task: &str, label: &str, name: &str, test_log: &str) -> String { @@ -329,7 +335,7 @@ fn parse_test_xml(path: &Path, bazelci_task: &str, label: &str) -> Result