Failed runs end with one fatal line; failure lines are errors
check / check (push) Canceled after 0s

A command that exits 1 because files or albums failed now ends with one
fatal line saying how many failed and where to look, so -q never leaves
a non-zero exit unexplained: backup points to failures.json, backup-metadata
to mlDataError in each file's JSON, and fix-missing-thumbnails to its
Failed files list. The progress callbacks of the backup, the metadata
backup and the thumbnail helpers take a level, so every line that reports
a failure is logged at error. The library's operation names are shown in
plain words. The README says which lines are error and warning, and which
summary lines --json replaces.

Model: opus-5-5
This commit is contained in:
2026-10-18 19:15:16 +00:00
parent f9969b2525
commit d87a5e7ef5
12 changed files with 253 additions and 63 deletions
+9 -6
View File
@@ -173,13 +173,13 @@ const FILES = "100\timage\tbeach.jpg\n";
// line for the one album whose files it fetched. Debug adds the start and end
// of the refresh, and trace each request with the status of its answer.
const INFO = "Fetched the files of 1 of 1 collections\n";
const DEBUG = "refresh started\n" + INFO + "refresh done\n";
const DEBUG = "Refresh started\n" + INFO + "Refresh done\n";
const TRACE =
"refresh started\n" +
"Refresh started\n" +
"GET https://api.ente.io/collections/v2?sinceTime=0: HTTP 200\n" +
"GET https://api.ente.io/collections/v2/diff?collectionID=1&sinceTime=0: HTTP 200\n" +
INFO +
"refresh done\n";
"Refresh done\n";
describe("the log level", () => {
it("is info by default", async () => {
@@ -326,6 +326,7 @@ describe("what the library reports", () => {
]);
});
// Each operation is named in plain words, as the README names it.
it("logs a refresh's progress at info, and its start and end at debug", () => {
const { log, lines } = collect();
const onProgress = logRefresh(log);
@@ -342,13 +343,15 @@ describe("what the library reports", () => {
status: "failed",
error: "HTTP 503",
});
onProgress({ operation: "fetchMLData", status: "started" });
onProgress({ operation: "fetchMLData", status: "done", fetched: 3 });
expect(lines).toEqual([
"debug: refresh started",
"debug: Refresh started",
"info: Fetched the files of 1 of 2 collections",
"debug: refresh failed: HTTP 503",
"debug: fetchMLData done",
"debug: Refresh failed: HTTP 503",
"debug: ML data fetch started",
"debug: ML data fetch done",
]);
});
});