Skip to content

Commit

Permalink
Set charset instead of encoding in testlog content type (#2135)
Browse files Browse the repository at this point in the history
`encoding` doesn't do anything, the correct property is `charset`.
  • Loading branch information
fmeum authored Dec 4, 2024
1 parent eaaf6c7 commit cf6309a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion agent/src/artifact/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ fn upload_test_log(
cwd.as_ref().map(|pb| pb.as_path()),
&artifact,
mode,
Some("text/plain;encoding=utf-8"),
Some("text/plain;charset=utf-8"),
);
}

Expand Down
8 changes: 4 additions & 4 deletions agent/tests/artifact/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn test_logs_uploaded_to_buildkite() -> Result<()> {
]);
cmd.assert()
.success()
.stdout(predicates::ord::eq("buildkite-agent artifact upload --content-type text/plain;encoding=utf-8 src\\test\\shell\\bazel\\resource_compiler_toolchain_test\\test.log\n"));
.stdout(predicates::ord::eq("buildkite-agent artifact upload --content-type text/plain;charset=utf-8 src\\test\\shell\\bazel\\resource_compiler_toolchain_test\\test.log\n"));

Ok(())
}
Expand All @@ -37,7 +37,7 @@ fn test_logs_uploaded_to_buildkite() -> Result<()> {
]);
cmd.assert()
.success()
.stdout(predicates::ord::eq("buildkite-agent artifact upload --content-type text/plain;encoding=utf-8 src/test/shell/bazel/starlark_repository_test/shard_4_of_6/test_attempts/attempt_1.log\n"));
.stdout(predicates::ord::eq("buildkite-agent artifact upload --content-type text/plain;charset=utf-8 src/test/shell/bazel/starlark_repository_test/shard_4_of_6/test_attempts/attempt_1.log\n"));

Ok(())
}
Expand Down Expand Up @@ -139,7 +139,7 @@ fn test_logs_deduplicated() -> Result<()> {
]);
cmd.assert()
.success()
.stdout(predicates::str::contains("buildkite-agent artifact upload --content-type text/plain;encoding=utf-8 src/test/shell/bazel/starlark_repository_test/shard_4_of_6/test_attempts/attempt_1.log").count(1));
.stdout(predicates::str::contains("buildkite-agent artifact upload --content-type text/plain;charset=utf-8 src/test/shell/bazel/starlark_repository_test/shard_4_of_6/test_attempts/attempt_1.log").count(1));

Ok(())
}
Expand Down Expand Up @@ -178,7 +178,7 @@ fn test_running_json_file() -> Result<()> {

cmd.assert()
.success()
.stdout(predicates::str::contains("buildkite-agent artifact upload --content-type text/plain;encoding=utf-8 src/test/shell/bazel/starlark_repository_test/shard_4_of_6/test_attempts/attempt_1.log"));
.stdout(predicates::str::contains("buildkite-agent artifact upload --content-type text/plain;charset=utf-8 src/test/shell/bazel/starlark_repository_test/shard_4_of_6/test_attempts/attempt_1.log"));
Ok(())
})
}

0 comments on commit cf6309a

Please sign in to comment.