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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ jobs:
- suite: integration
path: tests/integration
max_workers: 2
test_timeout: 10000
test_timeout: 20000
env:
DATABASE_URL: postgres://junior:junior@localhost:5432/junior
REDIS_URL: redis://localhost:6379
Expand Down
9 changes: 3 additions & 6 deletions packages/junior/tests/component/artifacts.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { eq } from "drizzle-orm";
import { afterEach, describe, expect, it } from "vitest";
import type { AttachmentStorage } from "@/chat/attachments/storage";
import {
publishImage,
unpublishArtifact,
} from "@/chat/artifacts/store";
import { publishImage, unpublishArtifact } from "@/chat/artifacts/store";
import { publicArtifactGET } from "@/handlers/artifacts";
import { juniorArtifacts } from "@/db/schema";
import {
createLocalJuniorSqlFixture,
createJuniorSqlFixture,
type LocalJuniorSqlFixture,
} from "../fixtures/sql";
import { migrateSchema } from "@/chat/conversations/sql/migrations";
Expand Down Expand Up @@ -58,7 +55,7 @@ describe("public artifact route", () => {
});

async function setup() {
fixture = await createLocalJuniorSqlFixture();
fixture = await createJuniorSqlFixture();
await migrateSchema(fixture.sql);
return fixture;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { createSqlStore } from "@/chat/conversations/sql/store";
import { createPluginAnnotations } from "@/chat/plugins/annotations";
import { juniorConversationBriefs, juniorConversations } from "@/db/schema";
import { conversationBriefFixture } from "../../fixtures/conversation-brief";
import { createLocalJuniorSqlFixture } from "../../fixtures/sql";
import { createJuniorSqlFixture } from "../../fixtures/sql";

const tenantScope = {
kind: "public_provider_tenant" as const,
Expand All @@ -17,7 +17,7 @@ const tenantScope = {

describe("Conversation Brief search", () => {
it("searches only the latest public root Briefs in the authorized scope", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();
try {
await migrateSchema(fixture.sql);
const db = fixture.sql.db();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from "@/db/schema";
import { and, eq } from "drizzle-orm";
import {
createLocalJuniorSqlFixture,
createJuniorSqlFixture,
type LocalJuniorSqlFixture,
} from "../../fixtures/sql";

Expand Down Expand Up @@ -195,7 +195,7 @@ describe("Conversation Brief task", () => {
beforeEach(async () => {
setBriefsConfig({ enabled: true });
process.env.JUNIOR_STATE_ADAPTER = "memory";
fixture = await createLocalJuniorSqlFixture();
fixture = await createJuniorSqlFixture();
TEST.sql = fixture.sql;
TEST.calls.length = 0;
await migrateSchema(fixture.sql);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import { createDurableLocationConfigurationService } from "@/chat/configuration/sql";
import { migrateSchema } from "@/chat/conversations/sql/migrations";
import { createLocalJuniorSqlFixture } from "../../fixtures/sql";
import { createJuniorSqlFixture } from "../../fixtures/sql";

const DESTINATION = {
platform: "slack" as const,
Expand All @@ -27,7 +27,7 @@ function legacyConfiguration(value: string) {

describe("SQL location configuration", () => {
it("persists configuration independently of the legacy cache", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();
await migrateSchema(fixture.sql);

try {
Expand Down Expand Up @@ -61,7 +61,7 @@ describe("SQL location configuration", () => {
});

it("copies a live legacy record into SQL once", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();
await migrateSchema(fixture.sql);

try {
Expand Down Expand Up @@ -96,7 +96,7 @@ describe("SQL location configuration", () => {
});

it("keeps a concurrent SQL write over a stale legacy cutover", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();
await migrateSchema(fixture.sql);
const destination = {
platform: "slack" as const,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { createSqlConversationMessageSearchStore } from "@/chat/conversations/sq
import { createSqlStore } from "@/chat/conversations/sql/store";
import type { ConversationPrivacy } from "@/chat/conversation-privacy";
import { createPluginAnnotations } from "@/chat/plugins/annotations";
import { createLocalJuniorSqlFixture } from "../fixtures/sql";
import { createJuniorSqlFixture } from "../fixtures/sql";

describe("conversation message search", () => {
it("returns only public user and assistant messages from the authorized workspace", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
await migrateSchema(fixture.sql);
Expand Down
46 changes: 23 additions & 23 deletions packages/junior/tests/component/conversation-sql-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import {
} from "../fixtures/conversation-work";
import {
createConfiguredJuniorSqlFixture,
createLocalJuniorSqlFixture,
createJuniorSqlFixture,
} from "../fixtures/sql";

describe("conversation SQL store", () => {
it("binds one provider conversation to an existing durable conversation", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -89,7 +89,7 @@ describe("conversation SQL store", () => {
});

it("rejects provider conversation rebinding to another conversation", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -127,7 +127,7 @@ describe("conversation SQL store", () => {
});

it("rejects updates to a child whose parent has no persisted root", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -168,7 +168,7 @@ describe("conversation SQL store", () => {
});

it("requires a destination on first root upsert", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand All @@ -188,7 +188,7 @@ describe("conversation SQL store", () => {
});

it("persists queryable conversation records and linked identities", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -384,7 +384,7 @@ describe("conversation SQL store", () => {
});

it("links actor identities to users by case-insensitive verified email", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -493,7 +493,7 @@ describe("conversation SQL store", () => {
});

it("rejects a provider account already linked to another user", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
await migrateSchema(fixture.sql);
Expand Down Expand Up @@ -537,7 +537,7 @@ describe("conversation SQL store", () => {
});

it("falls back to the provider name when an actor has no linked user", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -575,7 +575,7 @@ describe("conversation SQL store", () => {
});

it("preserves an existing verified identity email when linking its user", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
await migrateSchema(fixture.sql);
Expand Down Expand Up @@ -647,7 +647,7 @@ describe("conversation SQL store", () => {
}, 15_000);

it("fills missing actor identity from later trusted profile observations", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -694,7 +694,7 @@ describe("conversation SQL store", () => {
});

it("persists session source set-once and ignores later turn anchors", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -757,7 +757,7 @@ describe("conversation SQL store", () => {
});

it("persists visibility from source signals and converges on newer signals", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -824,7 +824,7 @@ describe("conversation SQL store", () => {
});

it("leaves Slack visibility missing without a live signal", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -854,7 +854,7 @@ describe("conversation SQL store", () => {
});

it("resolves a known Slack destination by exact display name", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -899,7 +899,7 @@ describe("conversation SQL store", () => {
});

it("fails closed when a destination display name is ambiguous", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -940,7 +940,7 @@ describe("conversation SQL store", () => {
});

it("rejects legacy JSON metadata that was not migrated to foreign keys", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -1000,7 +1000,7 @@ INSERT INTO junior_conversations (
});

it("keeps newer SQL execution when a stale mirror arrives later", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -1054,7 +1054,7 @@ INSERT INTO junior_conversations (
});

it("replaces the matching run metrics after execution cursor changes", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -1197,7 +1197,7 @@ ORDER BY metric
});

it("keeps SQL execution timestamps when a fresh summary omits them", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -1248,7 +1248,7 @@ ORDER BY metric
});

it("keeps the earliest creation time across SQL metadata updates", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
const store = createSqlStore(fixture.sql);
Expand Down Expand Up @@ -1442,7 +1442,7 @@ ORDER BY metric
});

it("mirrors worker check-ins into SQL execution progress", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
vi.useFakeTimers({ now: 1_000 });
Expand Down Expand Up @@ -1496,7 +1496,7 @@ ORDER BY metric
});

it("mirrors mailbox drains into SQL execution progress", async () => {
const fixture = await createLocalJuniorSqlFixture();
const fixture = await createJuniorSqlFixture();

try {
await disconnectStateAdapter();
Expand Down
Loading
Loading