Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,13 +550,23 @@ jobs:
# a second full suite to a job that is already red and already inside a
# 30-minute wall — turning an informative red into a killed job with no
# attestation at all, which is the #16173 failure mode itself.
#
# `test test:repo` (#16466): six heavy packages split their suite into
# two turbo tasks -- `test` (package-local inputs) and `test:repo`
# (the repo-scanning tests, hashed on the wide `$TURBO_ROOT$` inputs
# that used to sit on `test`). Naming both runs a split package whole
# and is a no-op for every package without a `test:repo` script. The
# per-shard Turbo cache restored above (main-seeded) is what carries
# an unmoved `PKG#test` across a change outside the package; the
# completeness guard below reads both tasks' summaries. The cli slice
# leg stays `test`-only: cli is not split.
STATUS=0
LOGS=""
for LEG in __whole__ $SLICES; do
if [ "$LEG" = __whole__ ]; then
[ -n "$FILTERS" ] || continue
LOG="$RUNNER_TEMP/test-core-packages.log"
set -- pnpm turbo run test $FILTERS --concurrency=4 --summarize --log-order=stream
set -- pnpm turbo run test test:repo $FILTERS --concurrency=4 --summarize --log-order=stream
else
PKG="${LEG%%=*}"
SLICE="${LEG#*=}"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dev:crm": "node scripts/check-dev-prereqs.mjs && pnpm check:console-sha && pnpm --filter @objectstack/example-crm dev",
"dev:todo": "node scripts/check-dev-prereqs.mjs && pnpm check:console-sha && pnpm --filter @objectstack/example-todo dev",
"spec:rebuild": "turbo run build --filter=...@objectstack/spec",
"test": "VITEST_MAX_WORKERS=$(node scripts/vitest-worker-cap.mjs) turbo run test --concurrency=50%",
"test": "VITEST_MAX_WORKERS=$(node scripts/vitest-worker-cap.mjs) turbo run test test:repo --concurrency=50%",
"test:smoke": "turbo run test:smoke",
"typecheck": "turbo run typecheck",
"clean": "turbo run clean && rm -rf dist",
Expand Down
3 changes: 2 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.examples.json && pnpm check:test-typecheck",
"check:test-typecheck": "tsx ../../scripts/check-test-typecheck.mts --self-test && tsx ../../scripts/check-test-typecheck.mts --package packages/core --project tsconfig.test.json",
"gen:test-typecheck-debt": "tsx ../../scripts/check-test-typecheck.mts --update --package packages/core --project tsconfig.test.json",
"test": "vitest run",
"test": "vitest run --project local",
"test:repo": "vitest run --project repo",
"test:watch": "vitest"
},
"devDependencies": {
Expand Down
41 changes: 40 additions & 1 deletion packages/core/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,49 @@
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.

import { defineConfig } from 'vitest/config';
import { configDefaults, defineConfig } from 'vitest/config';
import { readFileSync } from 'node:fs';
import path from 'path';

// #16466 -- two vitest projects, two turbo tasks. `repo` owns the tests that read
// outside this package (the list is vitest.repo-tests.json, which
// check:cross-package-test-inputs holds equal to its own scan); `local` owns
// every other test file. turbo hashes the wide `$TURBO_ROOT$` inputs on
// `test:repo` only, so `test` stays cacheable across changes elsewhere in the
// repo. `extends: true` keeps the root options (aliases included) on both.
const REPO_TESTS: string[] = JSON.parse(readFileSync(path.join(__dirname, 'vitest.repo-tests.json'), 'utf8'));

export default defineConfig({
test: {
// Each project re-declares the root block's test options: a ROOT-level
// value is inert for a project run (measured on vitest 4.1.10, see
// check-registry-log-declared / check-console-intercept-disarm).
projects: [
{
extends: true,
test: {
name: 'local',
include: configDefaults.include,
exclude: [...configDefaults.exclude, ...REPO_TESTS],
globals: true, environment: 'node',
// A late console.* must not redden a green suite (#10374); see the root
// block. A ROOT-level value is inert for a project run, so it is
// declared here as well (scripts/check-console-intercept-disarm.mjs).
disableConsoleIntercept: true,
},
},
{
extends: true,
test: {
name: 'repo',
include: REPO_TESTS,
globals: true, environment: 'node',
// A late console.* must not redden a green suite (#10374); see the root
// block. A ROOT-level value is inert for a project run, so it is
// declared here as well (scripts/check-console-intercept-disarm.mjs).
disableConsoleIntercept: true,
},
},
],
// A late console.* must not redden a green suite (#10374): vitest's worker
// forwards console output over RPC and discards the promise, and a write
// landing after teardown's rpcDone() snapshot is rejected into an unhandled
Expand Down
4 changes: 4 additions & 0 deletions packages/core/vitest.repo-tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"src/security/authz-store-unavailable.test.ts",
"src/security/operation-private-keys.pin.test.ts"
]
3 changes: 2 additions & 1 deletion packages/objectql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
},
"scripts": {
"build": "tsup && node ../../scripts/check-dts-emitted.mjs",
"test": "vitest run",
"test": "vitest run --project local",
"test:repo": "vitest run --project repo",
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.scripts.json && pnpm check:test-typecheck",
"check:test-typecheck": "tsx ../../scripts/check-test-typecheck.mts --self-test && tsx ../../scripts/check-test-typecheck.mts --package packages/objectql --project tsconfig.test.json",
"gen:test-typecheck-debt": "tsx ../../scripts/check-test-typecheck.mts --update --package packages/objectql --project tsconfig.test.json"
Expand Down
48 changes: 47 additions & 1 deletion packages/objectql/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,56 @@
// cannot silently re-point that file's premise. Without those two lines the
// file's first case stays GREEN while testing `'warn'` under a name that says
// `info` — measured red before they were added.
import { defineConfig } from 'vitest/config';
import { configDefaults, defineConfig } from 'vitest/config';
import { readFileSync } from 'node:fs';
import path from 'node:path';

// #16466 -- two vitest projects, two turbo tasks. `repo` owns the tests that read
// outside this package (the list is vitest.repo-tests.json, which
// check:cross-package-test-inputs holds equal to its own scan); `local` owns
// every other test file. turbo hashes the wide `$TURBO_ROOT$` inputs on
// `test:repo` only, so `test` stays cacheable across changes elsewhere in the
// repo. `extends: true` keeps the root options (aliases included) on both.
const REPO_TESTS: string[] = JSON.parse(readFileSync(path.join(__dirname, 'vitest.repo-tests.json'), 'utf8'));

export default defineConfig({
test: {
// Each project re-declares the root block's test options: a ROOT-level
// value is inert for a project run (measured on vitest 4.1.10, see
// check-registry-log-declared / check-console-intercept-disarm).
projects: [
{
extends: true,
test: {
name: 'local',
include: configDefaults.include,
exclude: [...configDefaults.exclude, ...REPO_TESTS],
// #13517: quiet the registry's per-item registration chatter — the
// engine's own `OS_REGISTRY_LOG` seam, not a change to its shipped
// default. Enforced by scripts/check-registry-log-declared.mjs.
env: { OS_REGISTRY_LOG: 'warn' },
// A late console.* must not redden a green suite (#10374); see the root
// block. A ROOT-level value is inert for a project run, so it is
// declared here as well (scripts/check-console-intercept-disarm.mjs).
disableConsoleIntercept: true,
},
},
{
extends: true,
test: {
name: 'repo',
include: REPO_TESTS,
// #13517: quiet the registry's per-item registration chatter — the
// engine's own `OS_REGISTRY_LOG` seam, not a change to its shipped
// default. Enforced by scripts/check-registry-log-declared.mjs.
env: { OS_REGISTRY_LOG: 'warn' },
// A late console.* must not redden a green suite (#10374); see the root
// block. A ROOT-level value is inert for a project run, so it is
// declared here as well (scripts/check-console-intercept-disarm.mjs).
disableConsoleIntercept: true,
},
},
],
// A late console.* must not redden a green suite (#10374): vitest's worker
// forwards console output over RPC and discards the promise, and a write
// landing after teardown's rpcDone() snapshot is rejected into an unhandled
Expand Down
3 changes: 3 additions & 0 deletions packages/objectql/vitest.repo-tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"src/action-owner-key-single-source.test.ts"
]
3 changes: 2 additions & 1 deletion packages/rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"scripts": {
"build": "tsup --config ../../tsup.config.ts && node ../../scripts/check-dts-emitted.mjs",
"dev": "tsc -w",
"test": "vitest run",
"test": "vitest run --project local",
"test:repo": "vitest run --project repo",
"check:test-typecheck": "tsx ../../scripts/check-test-typecheck.mts --self-test && tsx ../../scripts/check-test-typecheck.mts --package packages/rest --project tsconfig.test.json",
"gen:test-typecheck-debt": "tsx ../../scripts/check-test-typecheck.mts --update --package packages/rest --project tsconfig.test.json",
"typecheck": "tsc --noEmit && pnpm check:test-typecheck"
Expand Down
49 changes: 48 additions & 1 deletion packages/rest/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,57 @@
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.

import { defineConfig } from 'vitest/config';
import { configDefaults, defineConfig } from 'vitest/config';
import { readFileSync } from 'node:fs';
import path from 'path';

// #16466 -- two vitest projects, two turbo tasks. `repo` owns the tests that read
// outside this package (the list is vitest.repo-tests.json, which
// check:cross-package-test-inputs holds equal to its own scan); `local` owns
// every other test file. turbo hashes the wide `$TURBO_ROOT$` inputs on
// `test:repo` only, so `test` stays cacheable across changes elsewhere in the
// repo. `extends: true` keeps the root options (aliases included) on both.
const REPO_TESTS: string[] = JSON.parse(readFileSync(path.join(__dirname, 'vitest.repo-tests.json'), 'utf8'));

export default defineConfig({
test: {
// Each project re-declares the root block's test options: a ROOT-level
// value is inert for a project run (measured on vitest 4.1.10, see
// check-registry-log-declared / check-console-intercept-disarm).
projects: [
{
extends: true,
test: {
name: 'local',
include: configDefaults.include,
exclude: [...configDefaults.exclude, ...REPO_TESTS],
globals: true, environment: 'node',
// #13517: quiet the registry's per-item registration chatter — the
// engine's own `OS_REGISTRY_LOG` seam, not a change to its shipped
// default. Enforced by scripts/check-registry-log-declared.mjs.
env: { OS_REGISTRY_LOG: 'warn' },
// A late console.* must not redden a green suite (#10374); see the root
// block. A ROOT-level value is inert for a project run, so it is
// declared here as well (scripts/check-console-intercept-disarm.mjs).
disableConsoleIntercept: true,
},
},
{
extends: true,
test: {
name: 'repo',
include: REPO_TESTS,
globals: true, environment: 'node',
// #13517: quiet the registry's per-item registration chatter — the
// engine's own `OS_REGISTRY_LOG` seam, not a change to its shipped
// default. Enforced by scripts/check-registry-log-declared.mjs.
env: { OS_REGISTRY_LOG: 'warn' },
// A late console.* must not redden a green suite (#10374); see the root
// block. A ROOT-level value is inert for a project run, so it is
// declared here as well (scripts/check-console-intercept-disarm.mjs).
disableConsoleIntercept: true,
},
},
],
// A late console.* must not redden a green suite (#10374): vitest's worker
// forwards console output over RPC and discards the promise, and a write
// landing after teardown's rpcDone() snapshot is rejected into an unhandled
Expand Down
3 changes: 3 additions & 0 deletions packages/rest/vitest.repo-tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"src/meta-state-route-doc-spelling.test.ts"
]
3 changes: 2 additions & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"typecheck": "tsc --noEmit && pnpm check:test-typecheck",
"check:test-typecheck": "tsx ../../scripts/check-test-typecheck.mts --self-test && tsx ../../scripts/check-test-typecheck.mts --package packages/runtime --project tsconfig.test.json",
"gen:test-typecheck-debt": "tsx ../../scripts/check-test-typecheck.mts --update --package packages/runtime --project tsconfig.test.json",
"test": "vitest run"
"test": "vitest run --project local",
"test:repo": "vitest run --project repo"
},
"dependencies": {
"@objectstack/core": "workspace:*",
Expand Down
50 changes: 48 additions & 2 deletions packages/runtime/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,18 @@
// than production. The request lives HERE, in the harness, where the test
// author can see it.

import { defineConfig } from 'vitest/config';
import { configDefaults, defineConfig } from 'vitest/config';
import { readFileSync } from 'node:fs';
import path from 'node:path';

// #16466 -- two vitest projects, two turbo tasks. `repo` owns the tests that read
// outside this package (the list is vitest.repo-tests.json, which
// check:cross-package-test-inputs holds equal to its own scan); `local` owns
// every other test file. turbo hashes the wide `$TURBO_ROOT$` inputs on
// `test:repo` only, so `test` stays cacheable across changes elsewhere in the
// repo. `extends: true` keeps the root options (aliases included) on both.
const REPO_TESTS: string[] = JSON.parse(readFileSync(path.join(__dirname, 'vitest.repo-tests.json'), 'utf8'));

export default defineConfig({
resolve: {
// ARRAY form, not the object form: only the array form accepts a RegExp
Expand Down Expand Up @@ -146,6 +155,44 @@ export default defineConfig({
],
},
test: {
// Each project re-declares the root block's test options: a ROOT-level
// value is inert for a project run (measured on vitest 4.1.10, see
// check-registry-log-declared / check-console-intercept-disarm).
projects: [
{
extends: true,
test: {
name: 'local',
include: ['src/**/*.test.ts'],
exclude: [...configDefaults.exclude, ...REPO_TESTS],
globals: true, environment: 'node',
// #13517: quiet the registry's per-item registration chatter — the
// engine's own `OS_REGISTRY_LOG` seam, not a change to its shipped
// default. Enforced by scripts/check-registry-log-declared.mjs.
env: { OS_REGISTRY_LOG: 'warn' },
// A late console.* must not redden a green suite (#10374); see the root
// block. A ROOT-level value is inert for a project run, so it is
// declared here as well (scripts/check-console-intercept-disarm.mjs).
disableConsoleIntercept: true,
},
},
{
extends: true,
test: {
name: 'repo',
include: REPO_TESTS,
globals: true, environment: 'node',
// #13517: quiet the registry's per-item registration chatter — the
// engine's own `OS_REGISTRY_LOG` seam, not a change to its shipped
// default. Enforced by scripts/check-registry-log-declared.mjs.
env: { OS_REGISTRY_LOG: 'warn' },
// A late console.* must not redden a green suite (#10374); see the root
// block. A ROOT-level value is inert for a project run, so it is
// declared here as well (scripts/check-console-intercept-disarm.mjs).
disableConsoleIntercept: true,
},
},
],
// A late console.* must not redden a green suite (#10374): vitest's worker
// forwards console output over RPC and discards the promise, and a write
// landing after teardown's rpcDone() snapshot is rejected into an unhandled
Expand All @@ -160,6 +207,5 @@ export default defineConfig({
env: { OS_REGISTRY_LOG: 'warn' },
globals: true,
environment: 'node',
include: ['src/**/*.test.ts'],
},
});
4 changes: 4 additions & 0 deletions packages/runtime/vitest.repo-tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"src/action-owner-key-single-source.test.ts",
"src/error-envelope.conformance.test.ts"
]
3 changes: 2 additions & 1 deletion packages/spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@
"check:spec-changes": "tsx scripts/build-spec-changes.ts --check",
"gen:upgrade-guide": "tsx scripts/build-upgrade-guide.ts",
"check:upgrade-guide": "tsx scripts/build-upgrade-guide.ts --check",
"test": "vitest run",
"test": "vitest run --project local",
"test:repo": "vitest run --project repo",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"check:liveness": "tsx scripts/liveness/check-liveness.mts",
Expand Down
Loading
Loading