test(ci): verify resolved cache inputs instead of glob spelling

This commit is contained in:
morluto 2026-10-14 06:16:00 +08:00
parent f0e86997aa
commit 70c238e376
2 changed files with 10 additions and 6 deletions

View File

@ -226,10 +226,6 @@ it("bounds the rolling static snapshot with Turbo age and size eviction", async
.object({
cacheMaxAge: z.string(),
cacheMaxSize: z.string(),
tasks: z.record(
z.string(),
z.object({ inputs: z.array(z.unknown()).optional() }),
),
})
.parse(JSON.parse(await readFile(join(repository, "turbo.json"), "utf8")));
// The static job restores the previous snapshot by prefix and saves the
@ -248,5 +244,4 @@ it("bounds the rolling static snapshot with Turbo age and size eviction", async
unit === "TB" ? value * 1024 * 1024 : unit === "GB" ? value * 1024 : value;
expect(megabytes).toBeGreaterThan(0);
expect(megabytes).toBeLessThanOrEqual(1024);
expect(turbo.tasks["knip"]?.inputs).toContain("vitest.config.ts");
});

View File

@ -49,7 +49,7 @@ const lintDiagnostics = async (root: string) =>
),
).diagnostics;
it("includes every actually linted file in both cached lint task inputs", () => {
it("covers the lint inventory and root tool configs in resolved cache inputs", () => {
const scan = spawnSync(
process.execPath,
[join(repository, "node_modules/oxlint/bin/oxlint"), "--debug=files"],
@ -69,6 +69,7 @@ it("includes every actually linted file in both cached lint task inputs", () =>
"run",
"lint",
"lint:built",
"knip",
"--dry=json",
],
{
@ -99,6 +100,14 @@ it("includes every actually linted file in both cached lint task inputs", () =>
files.filter((file) => !Object.hasOwn(task.inputs, file)),
`${task.task} omits actual checker inputs`,
).toEqual([]);
const knip = tasks.find(({ task }) => task === "knip");
expect(knip).toBeDefined();
expect(
files.filter(
(file) => !file.includes("/") && !Object.hasOwn(knip!.inputs, file),
),
"knip omits root tool configuration inputs",
).toEqual([]);
});
it("summarizes warnings without losing their complete diagnostic records", async () => {