quiet tests

This commit is contained in:
Emil Lerch 2026-06-26 23:36:39 -07:00
parent aa8dafa3ab
commit fa4ec246c2
Signed by: lobo
GPG key ID: A7B62D657EF764F8

View file

@ -1,4 +1,5 @@
const std = @import("std");
const builtin = @import("builtin");
const log = std.log.scoped(.http);
@ -406,10 +407,17 @@ pub const Client = struct {
// those to debug so the warn-level log stream
// stays focused on cases the operator can act on
// (auth, rate, server outages).
if (response.status == .not_found) {
log.debug("http rejection body status=404 body={s}", .{response.body});
} else {
log.warn("http rejection body status={d} body={s}", .{ @intFromEnum(response.status), response.body });
//
// Skipped entirely under `zig build test`: the
// error-classification tests intentionally drive
// non-2xx statuses through here, and their warn
// output would otherwise pollute the test stream.
if (!builtin.is_test) {
if (response.status == .not_found) {
log.debug("http rejection body status=404 body={s}", .{response.body});
} else {
log.warn("http rejection body status={d} body={s}", .{ @intFromEnum(response.status), response.body });
}
}
response.allocator.free(response.body);
if (response.etag) |e| response.allocator.free(e);