/**
 * Long random walks through every provider's cache model (see tests/support/cache-walk.ts).
 * Scale up locally with FUZZ_FROM, FUZZ_TO (seed range), FUZZ_STEPS and FUZZ_PROVIDER;
 * a failure prints the seed, the replay command and the shortest operation list that still fails.
 */
import test from "node:test";
import { PROVIDER_NAMES, runWalk, type ProviderName } from "./support/cache-walk.ts";

const FROM = Number(process.env.FUZZ_FROM ?? 1);
const TO = Number(process.env.FUZZ_TO ?? 8);
const STEPS = Number(process.env.FUZZ_STEPS ?? 60);
const only = process.env.FUZZ_PROVIDER as ProviderName | undefined;

for (const provider of PROVIDER_NAMES) {
	if (only && provider !== only) continue;
	for (let seed = FROM; seed <= TO; seed++) test(`${provider} cache walk, seed ${seed}`, () => runWalk(provider, seed, STEPS));
}
