Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions tests/issue5219-bounded-boot-decode-cap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,20 @@ async function fixture(run: (dir: string, store: SessionStore) => Promise<void>)
}

async function withUnified(run: () => Promise<void>): Promise<void> {
const prev = process.env.BILI_STORAGE_UNIFIED;
const prevUnified = process.env.BILI_STORAGE_UNIFIED;
const prevWriter = process.env.BILI_STORAGE_JSON_WRITER;
process.env.BILI_STORAGE_UNIFIED = "full";
// The gate counts JSON-envelope decodes, which requires dual-write. A host
// config file with storage.jsonWriter=off (the pure-sqlite default since
// #6480 flips the "absent" tier off, and the file value always wins) would
// silently leave the disk empty and every count 0 — pin the writer on.
process.env.BILI_STORAGE_JSON_WRITER = "1";
try { await run(); }
finally {
if (prev === undefined) delete process.env.BILI_STORAGE_UNIFIED;
else process.env.BILI_STORAGE_UNIFIED = prev;
if (prevUnified === undefined) delete process.env.BILI_STORAGE_UNIFIED;
else process.env.BILI_STORAGE_UNIFIED = prevUnified;
if (prevWriter === undefined) delete process.env.BILI_STORAGE_JSON_WRITER;
else process.env.BILI_STORAGE_JSON_WRITER = prevWriter;
}
}

Expand Down
5 changes: 5 additions & 0 deletions tests/notice-registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ const cfgPath = path.join(fs.mkdtempSync(path.join(os.tmpdir(), "notice-reg-cfg-
process.env.DSH_HOME = fs.mkdtempSync(path.join(os.tmpdir(), "notice-reg-dsh-"));
process.env.XDG_STATE_HOME = stateDir;
process.env.BILI_CONFIG_FILE = cfgPath;
// #4011 lesson: this suite asserts the pure-sqlite default notice is visible,
// which requires the pure-sqlite SELECTION (unified "sqlite" or absent — the
// gate is unifiedSelectionIsSqlite, not the resolved mode). The suite baseline
// preload pins "legacy" for the broad corpus, so pin the selection explicitly.
process.env.BILI_STORAGE_UNIFIED = "sqlite";

const { NOTICES, visibleNotices, SQLITE_DEFAULT_NOTICE_ID } = await import("../src/notices.ts");
const { IOT_INCOMPAT_NOTICE_ID, PCK_NOTICE_ID, WM_FASTPATH_INTRO_ID, dismissUpgradeNotice } = await import("../src/pck-notice.ts");
Expand Down
Loading