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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
- run: bun run fmt:check

# A single fast pass over every workspace's tests. DB-gated suites
# (scripts/e2e/* included) skip themselves when DATABASE_URL is unset —
# see scripts/e2e/db-gate.ts — so this job needs no Postgres service.
# (e2e/* included) skip themselves when DATABASE_URL is unset —
# see e2e/db-gate.ts — so this job needs no Postgres service.
unit:
needs: setup
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tmp/
.corbits/

# Browser walkthrough harness screenshots + run summary (CL-6072)
scripts/e2e/browser/shots/
e2e/browser/shots/

# `bun pm pack` / `bun run release` tarballs — built on demand, never
# committed (CL-8167).
Expand Down
2 changes: 1 addition & 1 deletion apps/hub/test/composition.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { afterAll, expect, test } from "bun:test";
import { mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import path from "node:path";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { dbGate } from "../../../e2e/db-gate";

const databaseUrl = process.env["DATABASE_URL"] ?? "";
const describeIfDb = dbGate(databaseUrl, import.meta.path);
Expand Down
2 changes: 1 addition & 1 deletion apps/hub/test/mailbox-persist.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from "@corbits/mailbox";
import { createHubSessionLookups, type AgentRepoStore } from "@intx/hub-sessions";
import { createHubMailboxAuthorizeSender } from "../src/mailbox-persist";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { dbGate } from "../../../e2e/db-gate";

const databaseUrl = process.env["DATABASE_URL"] ?? "";
const describeIfDb = dbGate(databaseUrl, import.meta.path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
// scratch database, the real hub, the real sidecar, a stubbed provider
// credential) and drives the actual built web app in headless Chrome via
// puppeteer-core — clicking, typing, and screenshotting exactly as a human
// would. Scripted API-only e2e suites (scripts/e2e/*.test.ts) had been
// would. Scripted API-only e2e suites (e2e/*.test.ts) had been
// passing while the real UI broke; this is the acceptance mechanism for
// "works in the owner's browser."
//
// Run: bun run scripts/e2e/browser/walkthrough.ts
// Run: bun run e2e/browser/walkthrough.ts
// Requires: DATABASE_URL (see .env.example), and a system Chrome/Chromium
// (this script looks in the usual per-OS install locations — no download).
//
// Every step screenshots to scripts/e2e/browser/shots/NN-name.png and
// Every step screenshots to e2e/browser/shots/NN-name.png and
// records its own pass/repro-confirmed/fail outcome; the full run also
// writes scripts/e2e/browser/shots/summary.json. Re-runnable: resets its
// writes e2e/browser/shots/summary.json. Re-runnable: resets its
// own scratch database on every run. Finishes inside a 3-minute budget —
// every wait below is bounded, nothing blocks forever.

Expand All @@ -27,7 +27,7 @@ import { tmpdir } from "node:os";
import path from "node:path";
import puppeteer, { type Browser, type Page } from "puppeteer-core";

import { resetSchema, setupDatabase } from "../../db-setup.ts";
import { resetSchema, setupDatabase } from "../../scripts/db-setup.ts";
import {
e2eDatabaseUrl,
freePort,
Expand All @@ -37,7 +37,7 @@ import {
type HubHandle,
type SpawnedApp,
} from "../harness.ts";
import { OLLAMA_PLACEHOLDER_SECRET } from "../../../packages/connections/src/credential-test.ts";
import { OLLAMA_PLACEHOLDER_SECRET } from "../../packages/connections/src/credential-test.ts";

const REPO_ROOT = path.resolve(import.meta.dir, "..", "..", "..");
const WEB_DIR = path.join(REPO_ROOT, "apps", "web");
Expand Down
2 changes: 1 addition & 1 deletion scripts/e2e/database-url.ts → e2e/database-url.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// The env-gate half of scripts/e2e/harness.ts, split out so a DB-gated
// The env-gate half of e2e/harness.ts, split out so a DB-gated
// unit suite (every package's migrations.test.ts / *.drizzle.test.ts)
// can resolve DATABASE_URL without pulling in harness.ts's process-
// spawning machinery — which imports @corbits/connections and
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/e2e/harness.ts → e2e/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export async function connectE2eDb(databaseUrl: string): Promise<SqlClient> {
* connect-and-immediately-reject loop, not a usable dial-in. Every
* suite this repo runs against CI now lets the hub's own
* process-provisioner spawn a dedicated sidecar per allocation instead
* (see `startHub`'s doc comment and `scripts/e2e/chat.test.ts`); this
* (see `startHub`'s doc comment and `e2e/chat.test.ts`); this
* function is kept only for the handful of scripts not yet migrated off
* a directly-controlled sidecar process (e.g. ones that kill and
* restart a specific sidecar mid-scenario) and is not a working dial-in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// earn by producing no text, so nothing downstream mistakes the
// constant for a real answer.

import type { ApiCall } from "../../packages/hub-api-client/src/index.ts";
import type { ApiCall } from "../packages/hub-api-client/src/index.ts";
import {
ensureCatalogModel,
ensureCatalogOffering,
Expand All @@ -28,7 +28,7 @@ import {
ensureProvider,
inferenceCredentialName,
PLACEHOLDER_CATALOG_API_KEY,
} from "../../packages/connections/src/seed-catalog.ts";
} from "../packages/connections/src/seed-catalog.ts";

const NOOP_REPLY_TEXT = "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { describe, expect, test } from "bun:test";

import { resetSchema, setupDatabase } from "../db-setup.ts";
import { resetSchema, setupDatabase } from "../scripts/db-setup.ts";
import {
api,
createCleanupHarness,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import {
} from "@corbits/webhook-triggers";
import { describe, expect, test } from "bun:test";

import { resetSchema, setupDatabase } from "../db-setup.ts";
import { resetSchema, setupDatabase } from "../scripts/db-setup.ts";
import {
buildAssistantWorkflow,
serializeAssistantWorkflow,
} from "../../agents/assistant/src/index.ts";
} from "../agents/assistant/src/index.ts";
import { ensureNoopCatalogOffering, startNoopInferenceServer } from "./noop-inference-server.ts";
import { publishCorbitsToolsRegistry } from "../../packages/tool-registry-publish/src/publish.ts";
import { createHubAPI } from "../../packages/hub-api-client/src/index.ts";
import { publishCorbitsToolsRegistry } from "../packages/tool-registry-publish/src/publish.ts";
import { createHubAPI } from "../packages/hub-api-client/src/index.ts";
import {
api,
connectE2eDb,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// database URL is set or no gh auth is available (e.g. CI without a token).
import { describe, expect, test } from "bun:test";

import { resetSchema, setupDatabase } from "../db-setup.ts";
import { resetSchema, setupDatabase } from "../scripts/db-setup.ts";
import {
api,
createCleanupHarness,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

import { describe, expect, test } from "bun:test";

import { resetSchema, setupDatabase } from "../db-setup.ts";
import { resetSchema, setupDatabase } from "../scripts/db-setup.ts";
import {
buildAssistantWorkflow,
serializeAssistantWorkflow,
} from "../../agents/assistant/src/index.ts";
import { publishCorbitsToolsRegistry } from "../../packages/tool-registry-publish/src/publish.ts";
import { createHubAPI } from "../../packages/hub-api-client/src/index.ts";
} from "../agents/assistant/src/index.ts";
import { publishCorbitsToolsRegistry } from "../packages/tool-registry-publish/src/publish.ts";
import { createHubAPI } from "../packages/hub-api-client/src/index.ts";
import {
api,
assertNeverRealProvider,
Expand Down
4 changes: 2 additions & 2 deletions scripts/e2e/workflow-source.ts → e2e/workflow-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// Most harness consumers (spawning the hub/sidecar, calling its HTTP
// API) never touch these two; keeping them here means importing
// harness.ts no longer pays that load cost on their behalf.
import { createGitWorkflowPusher } from "../../packages/connections/src/workflow-push.ts";
import { WORKFLOW_SOURCE_ENTRY } from "../../packages/workflows/src/source.ts";
import { createGitWorkflowPusher } from "../packages/connections/src/workflow-push.ts";
import { WORKFLOW_SOURCE_ENTRY } from "../packages/workflows/src/source.ts";

/**
* Publishes a workflow definition into its asset repo in the one shape
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
"scripts": {
"check": "bun run typecheck && bun run lint && bun run fmt:check && bun run test",
"typecheck": "bun run scripts/typecheck.ts",
"lint": "oxlint apps packages tools agents skills workflows scripts test",
"fmt": "oxfmt apps packages tools agents skills workflows scripts test",
"fmt:check": "oxfmt --check apps packages tools agents skills workflows scripts test",
"hooks:install": "bun run scripts/hooks-install.ts",
"prepare": "bun run hooks:install",
"lint": "oxlint apps packages tools agents skills workflows scripts test e2e",
"fmt": "oxfmt apps packages tools agents skills workflows scripts test e2e",
"fmt:check": "oxfmt --check apps packages tools agents skills workflows scripts test e2e",
"build": "bun run scripts/run-all.ts build",
"test": "bun test ./scripts/*.test.ts && bun run scripts/run-all.ts test",
"test:e2e": "bun test scripts/e2e --max-concurrency=1",
"test": "bun run scripts/run-all.ts test",
"test:e2e": "bun test e2e --max-concurrency=1",
"dev": "bun run scripts/dev.ts",
"publish-tools": "bun scripts/publish-tools.ts",
"setup": "bun scripts/db-setup.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/agent-directory/test/routes.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { createAgentDefinitionRoutes } from "../src/routes";
import type { PinnedSkillIndexResolver } from "../src/routes";
import type { DefinitionAssetHistory } from "../src/definition-history";
import type { CapabilityInventoryProvider } from "../src/capability-inventory";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { dbGate } from "../../../e2e/db-gate";

const databaseUrl = process.env["DATABASE_URL"];
const describeIfDb = dbGate(databaseUrl, import.meta.path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import type { AssetService } from "@intx/hub-sessions";
import { CORBITS_TOOLS_REGISTRY } from "@corbits/tool-registry-publish";

import { dbTargetFromUrl } from "../../../scripts/db-setup";
import { e2eDatabaseUrl } from "../../../scripts/e2e/database-url";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { e2eDatabaseUrl } from "../../../e2e/database-url";
import { dbGate } from "../../../e2e/db-gate";
import { CapabilityOutOfInventoryError } from "../src/capability-inventory";
import { resolvePinnedVersion } from "../src/tool-package-version";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { afterAll, beforeAll, expect, test } from "bun:test";
import { createDB, runMigrations, dropSchema, schema } from "@intx/db";

import { dbTargetFromUrl } from "../../../scripts/db-setup";
import { e2eDatabaseUrl } from "../../../scripts/e2e/database-url";
import { e2eDatabaseUrl } from "../../../e2e/database-url";
import { listVisibleAgentDefinitions } from "../src/visible-definitions";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { dbGate } from "../../../e2e/db-gate";

const databaseUrl = e2eDatabaseUrl();
const describeIfDb = dbGate(databaseUrl, import.meta.path);
Expand Down
4 changes: 2 additions & 2 deletions packages/connections/src/connect-github-setup.race.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import {
} from "@corbits/webhook-triggers";
import type { GitHubRepoSummary } from "@corbits/github-tools";

import { e2eDatabaseUrl } from "../../../scripts/e2e/database-url";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { e2eDatabaseUrl } from "../../../e2e/database-url";
import { dbGate } from "../../../e2e/db-gate";
import {
startReviewingRepos,
webhookTriggerName,
Expand Down
2 changes: 1 addition & 1 deletion packages/connections/src/seed-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ export async function seedCatalog(args: SeedCatalogArgs): Promise<SeedCatalogRes
}

// The noop-inference offering planter (`ensureNoopCatalogOffering`) that
// used to live here moved to `scripts/e2e/noop-inference-server.ts`
// used to live here moved to `e2e/noop-inference-server.ts`
// (CL-8160): the hub no longer mounts a noop-inference route at all, so
// planting a catalog offering against one is exclusively an e2e-suite
// concern now, not something this connect-time planting module should
Expand Down
4 changes: 2 additions & 2 deletions packages/connections/test/mcp-server-store.drizzle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import { afterAll, beforeAll, expect, test } from "bun:test";
import { createDB, runMigrations, dropSchema, schema } from "@intx/db";

import { dbTargetFromUrl } from "../../../scripts/db-setup";
import { e2eDatabaseUrl } from "../../../scripts/e2e/database-url";
import { e2eDatabaseUrl } from "../../../e2e/database-url";
import { listMcpServerConnections } from "../src/mcp-server-store";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { dbGate } from "../../../e2e/db-gate";

const databaseUrl = e2eDatabaseUrl();
const describeIfDb = dbGate(databaseUrl, import.meta.path);
Expand Down
4 changes: 2 additions & 2 deletions packages/cron/test/ticker.drizzle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { createDB, dropSchema, runMigrations, schema } from "@intx/db";
import { eq } from "drizzle-orm";

import { dbTargetFromUrl } from "../../../scripts/db-setup";
import { e2eDatabaseUrl } from "../../../scripts/e2e/database-url";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { e2eDatabaseUrl } from "../../../e2e/database-url";
import { dbGate } from "../../../e2e/db-gate";
import { applyCronMigrations, cronScheduleTable } from "../src/schema";
import { createCronTicker } from "../src/ticker";

Expand Down
2 changes: 1 addition & 1 deletion packages/evals/src/store/store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import postgres from "postgres";
import { applyEvalsMigrations } from "./migrations.ts";
import { createPostgresEvalRunStore } from "./pg-store.ts";
import type { EvalRunResult } from "../types.ts";
import { assertDatabaseConfigured } from "../../../../scripts/e2e/db-gate.ts";
import { assertDatabaseConfigured } from "../../../../e2e/db-gate.ts";

function scratchDatabaseUrl(): string | undefined {
const base = process.env["DATABASE_URL"];
Expand Down
4 changes: 2 additions & 2 deletions packages/inbox/test/delivery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import {
} from "@corbits/notify";

import { setupDatabase } from "../../../scripts/db-setup";
import { e2eDatabaseUrl } from "../../../scripts/e2e/database-url";
import { e2eDatabaseUrl } from "../../../e2e/database-url";
import { createResolveExistingMailIds, createWorkbenchMailboxDelivery } from "../src/delivery";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { dbGate } from "../../../e2e/db-gate";

function scratchUrlFor(e2eUrl: string): string {
const url = new URL(e2eUrl);
Expand Down
4 changes: 2 additions & 2 deletions packages/migration-runner/test/migration-runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import { afterAll, beforeAll, expect, test } from "bun:test";
import postgres from "postgres";

import { e2eDatabaseUrl } from "../../../scripts/e2e/database-url";
import { e2eDatabaseUrl } from "../../../e2e/database-url";
import { applyPackageMigrations, type PackageMigration } from "../src/index";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { dbGate } from "../../../e2e/db-gate";

function scratchUrlFor(e2eUrl: string): string {
const url = new URL(e2eUrl);
Expand Down
2 changes: 1 addition & 1 deletion packages/notify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ cd packages/notify && bun test
```

`test/migrations.test.ts` is DB-gated against its own scratch database via
`scripts/e2e/harness.ts`'s `e2eDatabaseUrl` — set
`e2e/harness.ts`'s `e2eDatabaseUrl` — set
`DATABASE_URL=postgres://localhost:5432/workbench_e2e` or it skips.
4 changes: 2 additions & 2 deletions packages/notify/test/migrations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { afterAll, beforeAll, expect, test } from "bun:test";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";

import { e2eDatabaseUrl } from "../../../scripts/e2e/database-url";
import { e2eDatabaseUrl } from "../../../e2e/database-url";
import { applyNotifyMigrations } from "../src/migrations";
import { createDrizzleNotifyDispatchStore } from "../src/store";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { dbGate } from "../../../e2e/db-gate";

function scratchUrlFor(e2eUrl: string): string {
const url = new URL(e2eUrl);
Expand Down
4 changes: 2 additions & 2 deletions packages/webhook-triggers/test/migrations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import { afterAll, beforeAll, expect, test } from "bun:test";
import postgres from "postgres";

import { e2eDatabaseUrl } from "../../../scripts/e2e/database-url";
import { e2eDatabaseUrl } from "../../../e2e/database-url";
import { applyWebhookTriggersMigrations } from "../src/migrations";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { dbGate } from "../../../e2e/db-gate";

function scratchUrlFor(e2eUrl: string): string {
const url = new URL(e2eUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import postgres from "postgres";

import { applyWebhookTriggersMigrations } from "../src/migrations";
import { createDrizzleRepoReviewLeaseStore } from "../src/repo-review-lease";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { dbGate } from "../../../e2e/db-gate";

function scratchUrlFor(e2eUrl: string): string {
const url = new URL(e2eUrl);
Expand Down
4 changes: 2 additions & 2 deletions packages/webhook-triggers/test/store.drizzle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
import { createEnvKeyCredentialCipher, createNoopCredentialCipher } from "@intx/crypto";

import { e2eDatabaseUrl } from "../../../scripts/e2e/database-url";
import { e2eDatabaseUrl } from "../../../e2e/database-url";
import { applyWebhookTriggersMigrations } from "../src/migrations";
import { createDrizzleWebhookTriggerStore } from "../src/store";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { dbGate } from "../../../e2e/db-gate";

function scratchUrlFor(e2eUrl: string): string {
const url = new URL(e2eUrl);
Expand Down
2 changes: 1 addition & 1 deletion packages/workflows/test/agent-session.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { eq } from "drizzle-orm";
import { createDB, schema, type DB } from "@intx/db";
import { generateId } from "@intx/hub-common";
import { resolveRunSessionId } from "@intx/hub-sessions";
import { dbGate } from "../../../scripts/e2e/db-gate";
import { dbGate } from "../../../e2e/db-gate";

import { ensureRunSession, recordAgentSessionAtProvision } from "../src/launch/agent-session";

Expand Down
Loading
Loading