chore: integrate v0.1 component branches
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { openAgentRunStoreFromEnv } from "../../mgr/store.js";
|
||||
import { postgresMigrationContract } from "../../mgr/postgres-store.js";
|
||||
import { redactText } from "../../common/redaction.js";
|
||||
import { AgentRunError } from "../../common/errors.js";
|
||||
import type { SelfTestCase } from "../harness.js";
|
||||
|
||||
const selfTest: SelfTestCase = async () => {
|
||||
assert.equal(redactText("Authorization: Bearer abc123"), "Authorization: Bearer REDACTED");
|
||||
assert.equal(redactText('{"token":"test-token-material"}').includes("test-token-material"), false);
|
||||
await assert.rejects(
|
||||
() => openAgentRunStoreFromEnv({}),
|
||||
(error) => error instanceof AgentRunError && error.failureKind === "infra-failed" && error.message.includes("DATABASE_URL is required"),
|
||||
);
|
||||
const postgresContract = postgresMigrationContract();
|
||||
assert.equal(postgresContract.latestMigrationId, "001_v01_initial_durable_store");
|
||||
assert.ok(Array.isArray(postgresContract.requiredTables));
|
||||
assert.ok(postgresContract.requiredTables.includes("agentrun_schema_migrations"));
|
||||
assert.ok(postgresContract.requiredTables.includes("agentrun_runs"));
|
||||
assert.ok(postgresContract.requiredTables.includes("agentrun_events"));
|
||||
return { name: "redaction-postgres", tests: ["redaction", "postgres-store-contract"] };
|
||||
};
|
||||
|
||||
export default selfTest;
|
||||
Reference in New Issue
Block a user