Skip to content

Commit bf9d28f

Browse files
backryundiegosouzapw
andcommitted
fix(tests): restore relocated db import and UNIT_SUBDIRS parity after tier split
The suite relocation left tests/unit/db/db-pre-migration-backup-retention-10421.test.ts importing ../../src (resolves to tests/src), and merge-train.sh / TIA omitted the moonshot and seekai prefixes that test:unit actually runs. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
1 parent d8300a4 commit bf9d28f

5 files changed

Lines changed: 21 additions & 3 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- **chore(tests):** split slow hermetic e2e (`tests/integration/e2e/`) and upstream-gated live (`tests/integration/live/`) out of the default `test:integration` glob so the default suite stays fast, and relocate unit suites into per-prefix subdirs with matching collectors ([#12606](https://github.com/diegosouzapw/OmniRoute/pull/12606)) — thanks @backryun

scripts/quality/select-impacted-tests.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const HUB_RE =
1212
// tests, and `src/**/__tests__`/`open-sse/**/__tests__`, which can't run under node:test.
1313
// Keep in sync with package.json test:unit* braces + serial + dashboard + *.test.mjs.
1414
const UNIT_SUBDIRS =
15-
"api|auth|authz|build|cli|cli-helper|combo|compression|correctness|cors|dashboard|db|db-adapters|docs|gamification|guardrails|lib|mcp|memory|runtime|security|services|settings|shared|translator|ui|usage|serial";
15+
"a2a|account|adaptive|admission|adobe|agent|agentSkills|agentrouter|agy|aihorde|alibaba|anthropic|antigravity|api|apikeys|audio|audit|auth|authz|auto|bailian|base|batch|blackbox|bug|build|bulk|cache|call|catalog|cc|chat|chatcore|chatgpt|check|circuit|claude|cli|cli-helper|cline|cliproxyapi|cloud|cloudflare|codex|combo|combos|command|compression|conductor|connection|context|copilot|correctness|cors|credential|crof|cursor|custom|dahl|dashboard|db|db-adapters|deepseek|dev|devin|docker|dockerfile|docs|domain|duckduckgo|electron|embedding|embeddings|empty|error|exclusive|executor|firecrawl|fix|free|freeProviderRankings|fusion|gamification|gemini|github|gitlab|glm|grok|guardrails|headroom|helpers|home|homolog|i18n|image|inspector|instrumentation|issue|json|kie|kimi|kiro|lib|live|lmarena|local|log|m365|management|mcp|media|memory|microsoft|migration|minimax|misc|mitm|modality|model|models|moonshot|muse|no|noauth|notion|nvidia|oauth|obsidian|ocr|ollama|openai|openapi|opencode|openrouter|pack|perplexity|playground|plugins|pricing|probe|prompt|provider|providers|proxy|proxyfetch|qoder|quota|qwen|radar|rate|rateLimitManager|reasoning|refactor|relay|remote|repro|request|rerank|resilience|resolve|resource|responses|route|router|routing|run|runtime|search|security|seekai|serial|service|services|session|settings|shared|sidebar|skills|socks|sse|stream|sync|synced|system|task|test|thinking|tls|token|tool|topology|tproxy|translator|ts7|uc|ui|upstream|usage|v1|v388|validation|vercel|vertex|video|vision|vscode|web|webhook|windows|xai|zai|zed";
1616
// .ts: top-level + UNIT_SUBDIRS (mirrors package.json brace globs).
1717
// .mjs: package.json uses tests/unit/**/*.test.mjs (any depth under tests/unit).
1818
const TEST_RE = new RegExp(

scripts/release/merge-train.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ if [ "$FAST" = "1" ]; then
171171
| grep -E '\.test\.(ts|mjs)$' || true)
172172
# Subdirs test:unit actually runs (package.json allowlist) — anything else under
173173
# tests/unit/<sub>/ belongs to another runner (e.g. autoCombo -> vitest).
174-
UNIT_SUBDIRS=",a2a,account,adaptive,admission,adobe,agent,agentSkills,agentrouter,agy,aihorde,alibaba,anthropic,antigravity,api,apikeys,audio,audit,auth,authz,auto,bailian,base,batch,blackbox,bug,build,bulk,cache,call,catalog,cc,chat,chatcore,chatgpt,check,circuit,claude,cli,cli-helper,cline,cliproxyapi,cloud,cloudflare,codex,combo,combos,command,compression,conductor,connection,context,copilot,correctness,cors,credential,crof,cursor,custom,dahl,dashboard,db,db-adapters,deepseek,dev,devin,docker,dockerfile,docs,domain,duckduckgo,electron,embedding,embeddings,empty,error,exclusive,executor,firecrawl,fix,free,freeProviderRankings,fusion,gamification,gemini,github,gitlab,glm,grok,guardrails,headroom,helpers,home,homolog,i18n,image,inspector,instrumentation,issue,json,kie,kimi,kiro,lib,live,lmarena,local,log,m365,management,mcp,media,memory,microsoft,migration,minimax,misc,mitm,modality,model,models,muse,no,noauth,notion,nvidia,oauth,obsidian,ocr,ollama,openai,openapi,opencode,openrouter,pack,perplexity,playground,plugins,pricing,probe,prompt,provider,providers,proxy,proxyfetch,qoder,quota,qwen,radar,rate,rateLimitManager,reasoning,refactor,relay,remote,repro,request,rerank,resilience,resolve,resource,responses,route,router,routing,run,runtime,search,security,service,services,session,settings,shared,sidebar,skills,socks,sse,stream,sync,synced,system,task,test,thinking,tls,token,tool,topology,tproxy,translator,ts7,uc,ui,upstream,usage,v1,v388,validation,vercel,vertex,video,vision,vscode,web,webhook,windows,xai,zai,zed,"
174+
UNIT_SUBDIRS=",a2a,account,adaptive,admission,adobe,agent,agentSkills,agentrouter,agy,aihorde,alibaba,anthropic,antigravity,api,apikeys,audio,audit,auth,authz,auto,bailian,base,batch,blackbox,bug,build,bulk,cache,call,catalog,cc,chat,chatcore,chatgpt,check,circuit,claude,cli,cli-helper,cline,cliproxyapi,cloud,cloudflare,codex,combo,combos,command,compression,conductor,connection,context,copilot,correctness,cors,credential,crof,cursor,custom,dahl,dashboard,db,db-adapters,deepseek,dev,devin,docker,dockerfile,docs,domain,duckduckgo,electron,embedding,embeddings,empty,error,exclusive,executor,firecrawl,fix,free,freeProviderRankings,fusion,gamification,gemini,github,gitlab,glm,grok,guardrails,headroom,helpers,home,homolog,i18n,image,inspector,instrumentation,issue,json,kie,kimi,kiro,lib,live,lmarena,local,log,m365,management,mcp,media,memory,microsoft,migration,minimax,misc,mitm,modality,model,models,moonshot,muse,no,noauth,notion,nvidia,oauth,obsidian,ocr,ollama,openai,openapi,opencode,openrouter,pack,perplexity,playground,plugins,pricing,probe,prompt,provider,providers,proxy,proxyfetch,qoder,quota,qwen,radar,rate,rateLimitManager,reasoning,refactor,relay,remote,repro,request,rerank,resilience,resolve,resource,responses,route,router,routing,run,runtime,search,security,seekai,service,services,session,settings,shared,sidebar,skills,socks,sse,stream,sync,synced,system,task,test,thinking,tls,token,tool,topology,tproxy,translator,ts7,uc,ui,upstream,usage,v1,v388,validation,vercel,vertex,video,vision,vscode,web,webhook,windows,xai,zai,zed,"
175175
MAIN=()
176176
DASH=()
177177
SERIAL=()

tests/unit/db/db-pre-migration-backup-retention-10421.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { pathToFileURL } from "node:url";
1717

1818
import Database from "better-sqlite3";
1919

20-
import { createBetterSqliteAdapter } from "../../src/lib/db/adapters/betterSqliteAdapter.ts";
20+
import { createBetterSqliteAdapter } from "../../../src/lib/db/adapters/betterSqliteAdapter.ts";
2121

2222
const serial = { concurrency: false };
2323

tests/unit/test/select-impacted-tests.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,23 @@ test("changed unit test under serial/ → run itself", () => {
106106
assert.deepEqual(sel, ["tests/unit/serial/flaky-once.test.ts"]);
107107
});
108108

109+
// Relocated prefixes (#12606) must stay in UNIT_SUBDIRS or TIA silently drops them.
110+
test("changed unit test under moonshot/ → run itself", () => {
111+
const sel = selectImpacted({
112+
changed: ["tests/unit/moonshot/provider.test.ts"],
113+
map: MAP,
114+
});
115+
assert.deepEqual(sel, ["tests/unit/moonshot/provider.test.ts"]);
116+
});
117+
118+
test("changed unit test under seekai/ → run itself", () => {
119+
const sel = selectImpacted({
120+
changed: ["tests/unit/seekai/seekai-provider.test.ts"],
121+
map: MAP,
122+
});
123+
assert.deepEqual(sel, ["tests/unit/seekai/seekai-provider.test.ts"]);
124+
});
125+
109126
test("changed unit .test.mjs → run itself", () => {
110127
const sel = selectImpacted({
111128
changed: ["tests/unit/example.test.mjs"],

0 commit comments

Comments
 (0)