Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as opaque submodule gitlinks on GitHub) into fully-tracked first-party content. AITM now merges its 7 vendored repos as first-party engines: - memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts - git: vendored C git (bundled binary) + gitnexus (in-process code intelligence) - agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess) Includes the full session's product build: Gitgram web/mobile/backend features, AITM website/CLI/MCP, the unified memory layer, engine build tooling (scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md), and extensive test suites. Build artifacts, node_modules, external/, and gemini-cli are gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
98 lines
2.9 KiB
TypeScript
98 lines
2.9 KiB
TypeScript
import { describe, it, expect, beforeAll, beforeEach } from "vitest";
|
|
import request from "supertest";
|
|
import type { Express } from "express";
|
|
import { seedTestData, createTestApp, TEST_API_KEY } from "../setup.js";
|
|
|
|
describe("Data Pipeline Integration", () => {
|
|
let app: Express;
|
|
|
|
beforeAll(async () => {
|
|
app = await createTestApp();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
seedTestData();
|
|
});
|
|
|
|
describe("POST /v1/pipeline", () => {
|
|
it("returns 201 with job id and status", async () => {
|
|
const res = await request(app)
|
|
.post("/v1/pipeline")
|
|
.set("X-API-Key", TEST_API_KEY)
|
|
.send({ format: "openai", redact_secrets: true });
|
|
|
|
expect(res.status).toBe(201);
|
|
expect(res.body).toHaveProperty("id");
|
|
expect(res.body.id).toMatch(/^pipeline_mock_/);
|
|
expect(res.body).toHaveProperty("status");
|
|
});
|
|
|
|
it("returns created_at in response", async () => {
|
|
const res = await request(app)
|
|
.post("/v1/pipeline")
|
|
.set("X-API-Key", TEST_API_KEY)
|
|
.send({ format: "openai", redact_secrets: true });
|
|
|
|
expect(res.status).toBe(201);
|
|
expect(res.body).toHaveProperty("created_at");
|
|
});
|
|
});
|
|
|
|
describe("GET /v1/pipeline", () => {
|
|
it("returns array of jobs including the created one", async () => {
|
|
const createRes = await request(app)
|
|
.post("/v1/pipeline")
|
|
.set("X-API-Key", TEST_API_KEY)
|
|
.send({ format: "openai", redact_secrets: true });
|
|
|
|
const jobId = createRes.body.id;
|
|
|
|
const res = await request(app)
|
|
.get("/v1/pipeline")
|
|
.set("X-API-Key", TEST_API_KEY);
|
|
|
|
expect(res.status).toBe(200);
|
|
expect(res.body).toHaveProperty("data");
|
|
expect(Array.isArray(res.body.data)).toBe(true);
|
|
expect(res.body.data.some((job: { id: string }) => job.id === jobId)).toBe(true);
|
|
});
|
|
});
|
|
|
|
describe("GET /v1/pipeline/:id", () => {
|
|
it("returns job details with correct id", async () => {
|
|
const createRes = await request(app)
|
|
.post("/v1/pipeline")
|
|
.set("X-API-Key", TEST_API_KEY)
|
|
.send({ format: "openai", redact_secrets: true });
|
|
|
|
const jobId = createRes.body.id;
|
|
|
|
const res = await request(app)
|
|
.get(`/v1/pipeline/${jobId}`)
|
|
.set("X-API-Key", TEST_API_KEY);
|
|
|
|
expect(res.status).toBe(200);
|
|
expect(res.body).toHaveProperty("id", jobId);
|
|
});
|
|
|
|
it("returns 404 for non-existent job", async () => {
|
|
const res = await request(app)
|
|
.get("/v1/pipeline/pipeline_mock_nonexistent")
|
|
.set("X-API-Key", TEST_API_KEY);
|
|
|
|
expect(res.status).toBe(404);
|
|
});
|
|
});
|
|
|
|
describe("DELETE /v1/pipeline/schedule", () => {
|
|
it("returns cancelled: true", async () => {
|
|
const res = await request(app)
|
|
.delete("/v1/pipeline/schedule")
|
|
.set("X-API-Key", TEST_API_KEY);
|
|
|
|
expect(res.status).toBe(200);
|
|
expect(res.body).toHaveProperty("cancelled", true);
|
|
});
|
|
});
|
|
});
|