mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-19 21:52:21 +03:00
test(fix): refresh expired alibaba quota sample validity and onnxruntime pin for v3.8.50 base
- alibaba-free-tier-quota-fetcher.test.ts: sample quotaValidityPeriod (2026-08-16 16:00 UTC) is in the past, making every quota entry classify as expired/not_capable; bump to 2028-01-01 UTC so the text/merge classification tests exercise the intended path again. - optional-transformers-dependency.test.ts: onnxruntime-node pin assertion updated from ~1.24.3 to ~1.27.0 to match package.json (bumped by #10403); the regular-not-optional intent is unchanged.
This commit is contained in:
@@ -41,7 +41,7 @@ const SAMPLE_CONSOLE_RESPONSE = {
|
||||
freeTierQuotas: [
|
||||
{
|
||||
quotaInitTotal: 1000000,
|
||||
quotaValidityPeriod: 1786896000000,
|
||||
quotaValidityPeriod: 1830297600000,
|
||||
freeTierOnly: true,
|
||||
quotaTotalPercentage: 99.98,
|
||||
model: "qwen3.6-plus",
|
||||
|
||||
@@ -15,7 +15,7 @@ test("@huggingface/transformers is a regular dependency so npm ci never skips it
|
||||
// pin dragged onnxruntime-node@1.21.0 whose NAN build no longer compiles), which
|
||||
// broke `npm ci`/`next build` with "Can't resolve @huggingface/transformers"
|
||||
// (lazy import in src/lib/memory/embedding/transformersLocal.ts). As a regular
|
||||
// dep with onnxruntime-node@~1.24.3 (napi prebuilds, no node-gyp) it stays
|
||||
// dep with onnxruntime-node@~1.27.0 (napi prebuilds, no node-gyp) it stays
|
||||
// installable and the memory embedding path requires() cleanly.
|
||||
const pkg = readJson<{
|
||||
dependencies?: Record<string, string>;
|
||||
@@ -38,13 +38,20 @@ test("transformers + onnxruntime-node are regular dependencies (not optional)",
|
||||
|
||||
assert.equal(
|
||||
pkg.dependencies?.["onnxruntime-node"],
|
||||
"~1.24.3",
|
||||
"~1.27.0",
|
||||
"onnxruntime-node is a regular dep (napi prebuilds, installable on Node 24/26)"
|
||||
);
|
||||
assert.equal(pkg.optionalDependencies?.["onnxruntime-node"], undefined);
|
||||
|
||||
const lock = readJson<{
|
||||
packages: Record<string, { optional?: boolean; dependencies?: Record<string, string>; optionalDependencies?: Record<string, string> }>;
|
||||
packages: Record<
|
||||
string,
|
||||
{
|
||||
optional?: boolean;
|
||||
dependencies?: Record<string, string>;
|
||||
optionalDependencies?: Record<string, string>;
|
||||
}
|
||||
>;
|
||||
}>("package-lock.json");
|
||||
|
||||
assert.equal(
|
||||
@@ -54,7 +61,16 @@ test("transformers + onnxruntime-node are regular dependencies (not optional)",
|
||||
);
|
||||
// Optional flag is only written `true` for genuinely optional packages;
|
||||
// regular deps leave it absent/null. Assert each is NOT optional.
|
||||
assert.ok(!lock.packages["node_modules/@huggingface/transformers"]?.optional, "transformers must not be marked optional in the lockfile");
|
||||
assert.ok(!lock.packages["node_modules/onnxruntime-node"]?.optional, "onnxruntime-node must not be marked optional in the lockfile");
|
||||
assert.ok(!lock.packages["node_modules/onnxruntime-common"]?.optional, "onnxruntime-common must not be marked optional in the lockfile");
|
||||
assert.ok(
|
||||
!lock.packages["node_modules/@huggingface/transformers"]?.optional,
|
||||
"transformers must not be marked optional in the lockfile"
|
||||
);
|
||||
assert.ok(
|
||||
!lock.packages["node_modules/onnxruntime-node"]?.optional,
|
||||
"onnxruntime-node must not be marked optional in the lockfile"
|
||||
);
|
||||
assert.ok(
|
||||
!lock.packages["node_modules/onnxruntime-common"]?.optional,
|
||||
"onnxruntime-common must not be marked optional in the lockfile"
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user