Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Fit OK Validation's slowest test cells under the PR budget (#7616)

Nick Gomezd4063b939096
diff --git a/knip.config.ts b/knip.config.ts
index e04bf5228..fac2580fe 100644
--- a/knip.config.ts
+++ b/knip.config.ts
@@ -157,11 +157,15 @@ export default {
'src/shadow-fixture-launch.test-helper.mjs',
],
project: 'src/**',
- ignoreDependencies: ['@types/shell-quote'],
+ ignoreDependencies: [
+ '@types/shell-quote',
+ ],
},
'packages/cli': {
entry: ['src/**/*.test.ts', 'scripts/*.ts', 'tests/**/*.ts', 'src/parse-worker.ts'],
- ignoreDependencies: ['yjs'],
+ ignoreDependencies: [
+ 'yjs',
+ ],
},
'packages/desktop': {
entry: [
diff --git a/package.json b/package.json
index 2737d70b7..d66969366 100644
--- a/package.json
+++ b/package.json
@@ -39,7 +39,7 @@
"lint:oxlint": "oxlint --max-warnings 0 .",
"format": "pnpm run lint:biome --write --unsafe",
"check": "pnpm run lint && pnpm exec turbo run build typecheck test test:uncached",
- "check:full:parallel": "pnpm run check:drift:guards && pnpm run check:server-test-inputs && pnpm run lint && pnpm run check:doc-links && vitest run --config vitest.scripts.config.ts && turbo run build typecheck check:dts test test:uncached test:dom test:integration:shard1 test:integration:shard2 test:integration:shard3 test:integration:shard4 test:integration:shard5 test:integration:shard6 test:conversion test:perf:regression:unit test:health:unit test:health test:e2e test:perf test:a11y --concurrency=100% --output-logs=errors-only",
+ "check:full:parallel": "pnpm run check:drift:guards && pnpm run check:server-test-inputs && pnpm run lint && pnpm run check:doc-links && vitest run --config vitest.scripts.config.ts && turbo run build typecheck check:dts test test:uncached test:dom test:integration:shard1 test:integration:shard2 test:integration:shard3 test:integration:shard4 test:integration:shard5 test:integration:shard6 test:integration:shard7 test:integration:shard8 test:integration:shard9 test:integration:shard10 test:integration:shard11 test:integration:shard12 test:conversion test:perf:regression:unit test:health:unit test:health test:e2e test:perf test:a11y --concurrency=100% --output-logs=errors-only",
"tier1": "pnpm run check",
"tier2": "pnpm run tier1 && turbo run test:perf:regression:unit test:health:unit test:health test:e2e",
"tier3": "STRESS_FIDELITY=1 pnpm run tier2",
diff --git a/packages/app/package.json b/packages/app/package.json
index 786ef408b..0a1924759 100644
--- a/packages/app/package.json
+++ b/packages/app/package.json
@@ -25,16 +25,25 @@
"format": "biome check --write .",
"test": "vitest run --config vitest.config.ts src/ tests/free-port.test.ts tests/temp-dir.test.ts tests/perf/fixtures/ tests/perf/lib/ tests/perf/profile.test.ts tests/perf/scenarios/sweep-cache-regime.smoke.test.ts tests/perf/scenarios/sweep-convention-cap-graduation.smoke.test.ts tests/stress/oracle-e-expectations.test.ts",
"test:dom": "vitest run --config vitest.dom.config.ts",
+ "test:dom:shard1": "vitest run --config vitest.dom.config.ts --shard=1/3",
+ "test:dom:shard2": "vitest run --config vitest.dom.config.ts --shard=2/3",
+ "test:dom:shard3": "vitest run --config vitest.dom.config.ts --shard=3/3",
"test:browser": "vitest run --config vitest.browser.config.ts",
"test:node": "vitest run --config vitest.node.config.ts",
"check": "node scripts/compile-i18n-catalogs.ts && tsc --noEmit && biome check . && pnpm run test && pnpm run test:dom && pnpm run test:integration && pnpm run test:conversion && pnpm -w run test:uncached",
"test:integration": "vitest run --config vitest.integration.config.ts",
- "test:integration:shard1": "vitest run --config vitest.integration.config.ts --shard=1/6",
- "test:integration:shard2": "vitest run --config vitest.integration.config.ts --shard=2/6",
- "test:integration:shard3": "vitest run --config vitest.integration.config.ts --shard=3/6",
- "test:integration:shard4": "vitest run --config vitest.integration.config.ts --shard=4/6",
- "test:integration:shard5": "vitest run --config vitest.integration.config.ts --shard=5/6",
- "test:integration:shard6": "vitest run --config vitest.integration.config.ts --shard=6/6",
+ "test:integration:shard1": "vitest run --config vitest.integration.config.ts --shard=1/12",
+ "test:integration:shard2": "vitest run --config vitest.integration.config.ts --shard=2/12",
+ "test:integration:shard3": "vitest run --config vitest.integration.config.ts --shard=3/12",
+ "test:integration:shard4": "vitest run --config vitest.integration.config.ts --shard=4/12",
+ "test:integration:shard5": "vitest run --config vitest.integration.config.ts --shard=5/12",
+ "test:integration:shard6": "vitest run --config vitest.integration.config.ts --shard=6/12",
+ "test:integration:shard7": "vitest run --config vitest.integration.config.ts --shard=7/12",
+ "test:integration:shard8": "vitest run --config vitest.integration.config.ts --shard=8/12",
+ "test:integration:shard9": "vitest run --config vitest.integration.config.ts --shard=9/12",
+ "test:integration:shard10": "vitest run --config vitest.integration.config.ts --shard=10/12",
+ "test:integration:shard11": "vitest run --config vitest.integration.config.ts --shard=11/12",
+ "test:integration:shard12": "vitest run --config vitest.integration.config.ts --shard=12/12",
"test:worker-lifetime": "vitest run --config vitest.worker-lifetime.config.ts",
"test:perf:sessions": "vitest run --config vitest.config.ts tests/integration/per-session-um-perf.test.ts --testTimeout 60000",
"test:conversion": "vitest run --config vitest.config.ts tests/conversion/",
diff --git a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts b/packages/app/tests/integration/bug3-source-mode-writeback.test.ts
index a50b00123..4549c74b3 100644
--- a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts
+++ b/packages/app/tests/integration/bug3-source-mode-writeback.test.ts
@@ -1,3 +1,4 @@
+
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { setTimeout as wait } from 'node:timers/promises';
diff --git a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts b/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts
index 6fcdc23f2..4fc2c11f9 100644
--- a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts
+++ b/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts
@@ -1,3 +1,4 @@
+
import { setTimeout as wait } from 'node:timers/promises';
import { normalizeBridge } from '@inkeep/open-knowledge-core';
import { updateYFragment } from '@tiptap/y-tiptap';
diff --git a/packages/app/tests/integration/interior-edit-freshness.test.ts b/packages/app/tests/integration/interior-edit-freshness.test.ts
index 40b5cdfd6..9f2f6feb6 100644
--- a/packages/app/tests/integration/interior-edit-freshness.test.ts
+++ b/packages/app/tests/integration/interior-edit-freshness.test.ts
@@ -1,3 +1,4 @@
+
import { setTimeout as wait } from 'node:timers/promises';
import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
diff --git a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts b/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts
index 93666af70..2a085742b 100644
--- a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts
+++ b/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts
@@ -1,3 +1,4 @@
+
import { setTimeout as wait } from 'node:timers/promises';
import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
diff --git a/packages/app/tests/integration/producer-guard-wiring.test.ts b/packages/app/tests/integration/producer-guard-wiring.test.ts
index 867598d34..878d5196b 100644
--- a/packages/app/tests/integration/producer-guard-wiring.test.ts
+++ b/packages/app/tests/integration/producer-guard-wiring.test.ts
@@ -1,3 +1,4 @@
+
import { setTimeout as wait } from 'node:timers/promises';
import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
diff --git a/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts b/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts
index 0970ac12f..4ada3cf26 100644
--- a/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts
+++ b/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts
@@ -1,3 +1,4 @@
+
import { randomUUID } from 'node:crypto';
import { afterEach, describe, expect, test } from 'vitest';
import { agentWriteMd, createTestServer, type TestServer } from './test-harness';
diff --git a/packages/app/tests/integration/qa-045-restore-after-gc.test.ts b/packages/app/tests/integration/qa-045-restore-after-gc.test.ts
index b632185e1..cbe2b705f 100644
--- a/packages/app/tests/integration/qa-045-restore-after-gc.test.ts
+++ b/packages/app/tests/integration/qa-045-restore-after-gc.test.ts
@@ -1,3 +1,4 @@
+
import { execFileSync } from 'node:child_process';
import { randomUUID } from 'node:crypto';
import { join } from 'node:path';
diff --git a/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts b/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts
index c530ce4ba..89bc9b4d9 100644
--- a/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts
+++ b/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts
@@ -1,3 +1,4 @@
+
import { randomUUID } from 'node:crypto';
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest';
import type * as Y from 'yjs';
diff --git a/packages/app/tests/integration/undo-after-rollback.test.ts b/packages/app/tests/integration/undo-after-rollback.test.ts
index d3767adc9..a78aeb0e4 100644
--- a/packages/app/tests/integration/undo-after-rollback.test.ts
+++ b/packages/app/tests/integration/undo-after-rollback.test.ts
@@ -1,3 +1,4 @@
+
import { ROLLBACK_ORIGIN } from '@inkeep/open-knowledge-server';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
import * as Y from 'yjs';
diff --git a/packages/app/tests/integration/undo-recycle-reset.test.ts b/packages/app/tests/integration/undo-recycle-reset.test.ts
index b076f955c..e7cc69c3f 100644
--- a/packages/app/tests/integration/undo-recycle-reset.test.ts
+++ b/packages/app/tests/integration/undo-recycle-reset.test.ts
@@ -1,3 +1,4 @@
+
import { writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { setTimeout as wait } from 'node:timers/promises';
diff --git a/packages/app/tests/integration/undo-rederive-survival.test.ts b/packages/app/tests/integration/undo-rederive-survival.test.ts
index 7935e35f8..9ddcd0730 100644
--- a/packages/app/tests/integration/undo-rederive-survival.test.ts
+++ b/packages/app/tests/integration/undo-rederive-survival.test.ts
@@ -1,3 +1,4 @@
+
import { prependFrontmatter } from '@inkeep/open-knowledge-core';
import { Plugin, PluginKey } from '@tiptap/pm/state';
import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
diff --git a/packages/app/vitest.integration.config.ts b/packages/app/vitest.integration.config.ts
index 1277a27eb..e61696535 100644
--- a/packages/app/vitest.integration.config.ts
+++ b/packages/app/vitest.integration.config.ts
@@ -6,12 +6,6 @@ export const WORKER_LIFETIME_TESTS = [
'tests/meta/standalone-prebuilt-worker-lifetime.test.ts',
];
-// Integration tier: multi-client CRDT convergence over the real Node test
-// harness (tests/integration) plus the meta suite. Reuses the
-// app base config (lingui macro shim, single-instance dedupe, development-
-// conditions pin, Bun global facade, per-test IDB reset); the three CI cells
-// map 1:1 onto vitest's native `--shard=1/3`, `--shard=2/3`, `--shard=3/3`.
-//
// `per-session-um-perf` is held out here because it is a perf tier with its own
// 60s-budget `test:perf:sessions` script. Bun's
// `--path-ignore-patterns=per-session-um-perf` was meant to exclude it but
diff --git a/packages/core/src/bridge/compose.ts b/packages/core/src/bridge/compose.ts
index f4cc8a286..2a597ec3d 100644
--- a/packages/core/src/bridge/compose.ts
+++ b/packages/core/src/bridge/compose.ts
@@ -1,3 +1,4 @@
+
import { prependFrontmatter, stripFrontmatter } from '../extensions/frontmatter.ts';
export type ComposeAdjustment = 'none' | 'body' | 'frontmatter' | 'unresolved';
diff --git a/packages/core/src/bridge/doc-boundary-space.ts b/packages/core/src/bridge/doc-boundary-space.ts
index e7e63f43d..ffd8fce06 100644
--- a/packages/core/src/bridge/doc-boundary-space.ts
+++ b/packages/core/src/bridge/doc-boundary-space.ts
@@ -1,3 +1,4 @@
+
import { FRONTMATTER_RE, stripFrontmatter } from '../extensions/frontmatter.ts';
import { carriedEdgeEmpties, type DocEdgeEmpties } from '../markdown/doc-edge-blank-runs.ts';
diff --git a/packages/core/src/markdown/comment-promoter.ts b/packages/core/src/markdown/comment-promoter.ts
index fc267cbea..fb0ba5a7c 100644
--- a/packages/core/src/markdown/comment-promoter.ts
+++ b/packages/core/src/markdown/comment-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Paragraph, PhrasingContent, Root, RootContent, Text } from 'mdast';
import { SKIP, visit } from 'unist-util-visit';
import type { VFile } from 'vfile';
diff --git a/packages/core/src/markdown/merged-walker.ts b/packages/core/src/markdown/merged-walker.ts
index 861003fb4..ae8cb390b 100644
--- a/packages/core/src/markdown/merged-walker.ts
+++ b/packages/core/src/markdown/merged-walker.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Parent, Root } from 'mdast';
import { SKIP, visit } from 'unist-util-visit';
import type { VFile } from 'vfile';
diff --git a/packages/core/src/markdown/safe-url.ts b/packages/core/src/markdown/safe-url.ts
index 4d3250d3a..8be632ba4 100644
--- a/packages/core/src/markdown/safe-url.ts
+++ b/packages/core/src/markdown/safe-url.ts
@@ -1,3 +1,4 @@
+
export const SAFE_URL_SCHEMES = ['https', 'http', 'mailto', 'tel', 'ftp', 'sms'] as const;
const SCHEME_ALT = SAFE_URL_SCHEMES.map((s) => `${s}:`).join('|');
diff --git a/packages/server/package.json b/packages/server/package.json
index e7e466012..f95ed57b2 100644
--- a/packages/server/package.json
+++ b/packages/server/package.json
@@ -75,9 +75,10 @@
"build:skill-bundles": "node --import tsx scripts/build-skill-bundles.ts",
"typecheck": "pnpm run typecheck:bash && pnpm run typecheck:test-helper-callers && tsc",
"test": "vitest run",
- "test:shard1": "vitest run --shard=1/3",
- "test:shard2": "vitest run --shard=2/3",
- "test:shard3": "vitest run --shard=3/3",
+ "test:shard1": "vitest run --shard=1/4",
+ "test:shard2": "vitest run --shard=2/4",
+ "test:shard3": "vitest run --shard=3/4",
+ "test:shard4": "vitest run --shard=4/4",
"test:network": "vitest run --config vitest.network.config.ts",
"test:mcp-inspector": "vitest run --config vitest.mcp-inspector.config.ts",
"measure:generated-index-sweep": "node --import tsx --conditions=development measure-generated-index-sweep.ts",
diff --git a/turbo.json b/turbo.json
index 601581dde..ce04113ad 100644
--- a/turbo.json
+++ b/turbo.json
@@ -207,6 +207,22 @@
"test-results/vitest-test-shard3.provenance.json"
]
},
+ "@inkeep/open-knowledge-server#test:shard4": {
+ "dependsOn": ["^build"],
+ "cache": true,
+ "inputs": [
+ "$TURBO_DEFAULT$",
+ "!CHANGELOG.md",
+ "!README.md",
+ "../../test-support/*.ts",
+ "../../test-support/test-only-source-file.mjs",
+ "../app/src/editor/observers.ts"
+ ],
+ "outputs": [
+ "test-results/vitest-test-shard4.json",
+ "test-results/vitest-test-shard4.provenance.json"
+ ]
+ },
"@inkeep/open-knowledge#test": {
"dependsOn": ["^build", "build"],
"cache": true,
@@ -270,6 +286,57 @@
"test-results/vitest-test-dom.provenance.json"
]
},
+ "test:dom:shard1": {
+ "dependsOn": ["^build"],
+ "cache": true,
+ "inputs": [
+ "$TURBO_DEFAULT$",
+ "$TURBO_ROOT$/test-support/**",
+ "../core/src/**/*.ts",
+ "../server/src/**/*.ts",
+ "../md-conformance/src/**/*.ts",
+ "../md-conformance/src/**/*.json",
+ "../md-conformance/corpora/typed-view-scripts.json"
+ ],
+ "outputs": [
+ "test-results/vitest-test-dom-shard1.json",
+ "test-results/vitest-test-dom-shard1.provenance.json"
+ ]
+ },
+ "test:dom:shard2": {
+ "dependsOn": ["^build"],
+ "cache": true,
+ "inputs": [
+ "$TURBO_DEFAULT$",
+ "$TURBO_ROOT$/test-support/**",
+ "../core/src/**/*.ts",
+ "../server/src/**/*.ts",
+ "../md-conformance/src/**/*.ts",
+ "../md-conformance/src/**/*.json",
+ "../md-conformance/corpora/typed-view-scripts.json"
+ ],
+ "outputs": [
+ "test-results/vitest-test-dom-shard2.json",
+ "test-results/vitest-test-dom-shard2.provenance.json"
+ ]
+ },
+ "test:dom:shard3": {
+ "dependsOn": ["^build"],
+ "cache": true,
+ "inputs": [
+ "$TURBO_DEFAULT$",
+ "$TURBO_ROOT$/test-support/**",
+ "../core/src/**/*.ts",
+ "../server/src/**/*.ts",
+ "../md-conformance/src/**/*.ts",
+ "../md-conformance/src/**/*.json",
+ "../md-conformance/corpora/typed-view-scripts.json"
+ ],
+ "outputs": [
+ "test-results/vitest-test-dom-shard3.json",
+ "test-results/vitest-test-dom-shard3.provenance.json"
+ ]
+ },
"test:browser": {
"dependsOn": ["^build"],
"cache": false,
@@ -402,6 +469,108 @@
"test-results/vitest-test-integration-shard6.provenance.json"
]
},
+ "test:integration:shard7": {
+ "dependsOn": ["^build"],
+ "cache": true,
+ "inputs": [
+ "$TURBO_DEFAULT$",
+ "$TURBO_ROOT$/test-support/**",
+ "../server/src/**/*.ts",
+ "../core/src/**/*.ts",
+ "$TURBO_ROOT$/lint-plugins/no-comments/**",
+ "$TURBO_ROOT$/packages/cli/src/**",
+ "$TURBO_ROOT$/packages/cli/package.json"
+ ],
+ "outputs": [
+ "test-results/vitest-test-integration-shard7.json",
+ "test-results/vitest-test-integration-shard7.provenance.json"
+ ]
+ },
+ "test:integration:shard8": {
+ "dependsOn": ["^build"],
+ "cache": true,
+ "inputs": [
+ "$TURBO_DEFAULT$",
+ "$TURBO_ROOT$/test-support/**",
+ "../server/src/**/*.ts",
+ "../core/src/**/*.ts",
+ "$TURBO_ROOT$/lint-plugins/no-comments/**",
+ "$TURBO_ROOT$/packages/cli/src/**",
+ "$TURBO_ROOT$/packages/cli/package.json"
+ ],
+ "outputs": [
+ "test-results/vitest-test-integration-shard8.json",
+ "test-results/vitest-test-integration-shard8.provenance.json"
+ ]
+ },
+ "test:integration:shard9": {
+ "dependsOn": ["^build"],
+ "cache": true,
+ "inputs": [
+ "$TURBO_DEFAULT$",
+ "$TURBO_ROOT$/test-support/**",
+ "../server/src/**/*.ts",
+ "../core/src/**/*.ts",
+ "$TURBO_ROOT$/lint-plugins/no-comments/**",
+ "$TURBO_ROOT$/packages/cli/src/**",
+ "$TURBO_ROOT$/packages/cli/package.json"
+ ],
+ "outputs": [
+ "test-results/vitest-test-integration-shard9.json",
+ "test-results/vitest-test-integration-shard9.provenance.json"
+ ]
+ },
+ "test:integration:shard10": {
+ "dependsOn": ["^build"],
+ "cache": true,
+ "inputs": [
+ "$TURBO_DEFAULT$",
+ "$TURBO_ROOT$/test-support/**",
+ "../server/src/**/*.ts",
+ "../core/src/**/*.ts",
+ "$TURBO_ROOT$/lint-plugins/no-comments/**",
+ "$TURBO_ROOT$/packages/cli/src/**",
+ "$TURBO_ROOT$/packages/cli/package.json"
+ ],
+ "outputs": [
+ "test-results/vitest-test-integration-shard10.json",
+ "test-results/vitest-test-integration-shard10.provenance.json"
+ ]
+ },
+ "test:integration:shard11": {
+ "dependsOn": ["^build"],
+ "cache": true,
+ "inputs": [
+ "$TURBO_DEFAULT$",
+ "$TURBO_ROOT$/test-support/**",
+ "../server/src/**/*.ts",
+ "../core/src/**/*.ts",
+ "$TURBO_ROOT$/lint-plugins/no-comments/**",
+ "$TURBO_ROOT$/packages/cli/src/**",
+ "$TURBO_ROOT$/packages/cli/package.json"
+ ],
+ "outputs": [
+ "test-results/vitest-test-integration-shard11.json",
+ "test-results/vitest-test-integration-shard11.provenance.json"
+ ]
+ },
+ "test:integration:shard12": {
+ "dependsOn": ["^build"],
+ "cache": true,
+ "inputs": [
+ "$TURBO_DEFAULT$",
+ "$TURBO_ROOT$/test-support/**",
+ "../server/src/**/*.ts",
+ "../core/src/**/*.ts",
+ "$TURBO_ROOT$/lint-plugins/no-comments/**",
+ "$TURBO_ROOT$/packages/cli/src/**",
+ "$TURBO_ROOT$/packages/cli/package.json"
+ ],
+ "outputs": [
+ "test-results/vitest-test-integration-shard12.json",
+ "test-results/vitest-test-integration-shard12.provenance.json"
+ ]
+ },
"test:conversion": {
"dependsOn": ["^build"],
"cache": true,