Files
zeekay 1b367e2b62 chore: rebase the tree onto upstream master
The tree was a debranded snapshot of upstream taken around 2026-02-20, and
upstream has moved about five months since. This replaces it with upstream
master, mechanically re-derived: bin/debrand does the rename, and the
pipeline and squashed migrations are restored from the shipped tree.

Not a merge. The previous import replaced the tree wholesale in a single
commit, so there is no shared content history to merge against. Reproducing
the rename on the new tree is what actually converges.

What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints,
compose files, LLM.md, and insights/migrations. The squashed initial
migration is load-bearing — the live database records it by name, so
upstream's ~918 individual migrations cannot come back.

Nine products are dropped as unreferenced. Twenty-one more that we do not run
are kept anyway because the core app still imports them; unpicking those is a
refactor and does not belong in a rebase.

This base does not build yet, and the reasons are not in the rename:
upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against
our 4.2, and the dependency manifests still name upstream packages that we
republish under our own names. Those are decisions, not renames.
2026-08-01 15:44:40 -07:00

79 lines
2.9 KiB
TypeScript

import { PluginServer } from '../src/server'
import { PluginServerMode } from '../src/types'
import { resetTestDatabase } from './helpers/sql'
jest.setTimeout(20000) // 20 sec timeout - longer indicates an issue
describe('server', () => {
jest.retryTimes(3) // Flakey due to reliance on kafka/datastore
let pluginsServer: PluginServer | null = null
beforeEach(async () => {
jest.spyOn(process, 'exit').mockImplementation()
await resetTestDatabase()
})
afterEach(async () => {
if (pluginsServer) {
await pluginsServer.stop()
expect(process.exit).toHaveBeenCalledTimes(1)
expect(process.exit).toHaveBeenCalledWith(0)
pluginsServer = null
}
})
// Ingestion modes are handled by IngestionGeneralServer (see ingestion-general-server.test.ts)
it('should error on startup with ingestion mode', async () => {
const server = new PluginServer({
LOG_LEVEL: 'debug',
PLUGIN_SERVER_MODE: PluginServerMode.ingestion_v2,
})
await server.start()
// start() catches the error and calls stop(error) internally, which exits with 1
expect(process.exit).toHaveBeenCalledWith(1)
})
// Running all capabilities together takes too long in tests, so they are split up
it('should not error on startup - cdp', async () => {
pluginsServer = new PluginServer({
LOG_LEVEL: 'debug',
PLUGIN_SERVER_MODE: PluginServerMode.cdp_processed_events,
PERSONFN_ENABLED: true,
PERSONFN_ADDR: 'localhost:50052',
})
await pluginsServer.start()
})
// Replay modes are handled by IngestionSessionReplayServer (see ingestion-session-replay-server.test.ts)
it('should error on startup with replay mode', async () => {
const server = new PluginServer({
LOG_LEVEL: 'debug',
PLUGIN_SERVER_MODE: PluginServerMode.recordings_blob_ingestion_v2,
})
await server.start()
// start() catches the error and calls stop(error) internally, which exits with 1
expect(process.exit).toHaveBeenCalledWith(1)
})
// Logs mode is handled by IngestionLogsServer (see ingestion-logs-server.test.ts)
it('should error on startup with logs mode', async () => {
const server = new PluginServer({
LOG_LEVEL: 'debug',
PLUGIN_SERVER_MODE: PluginServerMode.ingestion_logs,
})
await server.start()
expect(process.exit).toHaveBeenCalledWith(1)
})
// Traces mode is handled by IngestionTracesServer (see ingestion-traces-server.test.ts)
it('should error on startup with traces mode', async () => {
const server = new PluginServer({
LOG_LEVEL: 'debug',
PLUGIN_SERVER_MODE: PluginServerMode.ingestion_traces,
})
await server.start()
expect(process.exit).toHaveBeenCalledWith(1)
})
})