Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { WorkerConfigError } from "@toolctrl/config";
|
||||
import type { ErrorReporter } from "@toolctrl/error-reporter";
|
||||
import { WorkerConfigError } from "@hivegrid/config";
|
||||
import type { ErrorReporter } from "@hivegrid/error-reporter";
|
||||
import { describe, expect, test, vi } from "vitest";
|
||||
import { queueNames, type QueueName, type TypedProcessor } from "@toolctrl/queue";
|
||||
import { queueNames, type QueueName, type TypedProcessor } from "@hivegrid/queue";
|
||||
import {
|
||||
shutdownWorkerRuntime,
|
||||
startWorkerRuntime,
|
||||
@@ -154,10 +154,9 @@ describe("worker runtime", () => {
|
||||
logger,
|
||||
});
|
||||
expect(runtime.status).toBe("started");
|
||||
expect(runtime.queueNames).toEqual([queueNames.notifications, queueNames.maintenance, queueNames.fileScan]);
|
||||
expect(runtime.queueNames).toEqual([queueNames.notifications, queueNames.maintenance, queueNames.fileScan, queueNames.filePreview]);
|
||||
expect(workerQueueNames).toEqual([queueNames.email, queueNames.notifications]);
|
||||
expect(workerQueueNames).not.toContain(queueNames.exports);
|
||||
expect(workerQueueNames).not.toContain(queueNames.aiChatbot);
|
||||
expect(workerQueueNames).not.toContain(queueNames.browserAutomation);
|
||||
expect(createWorkerImpl).toHaveBeenCalledTimes(runtime.queueNames.length);
|
||||
expect(vi.mocked(createWorkerImpl).mock.calls.map(([queueName]) => queueName)).toEqual(runtime.queueNames);
|
||||
@@ -185,11 +184,12 @@ describe("worker runtime", () => {
|
||||
logger,
|
||||
});
|
||||
|
||||
expect(runtime.queueNames).toEqual([queueNames.notifications, queueNames.maintenance, queueNames.fileScan]);
|
||||
expect(runtime.queueNames).toEqual([queueNames.notifications, queueNames.maintenance, queueNames.fileScan, queueNames.filePreview]);
|
||||
expect(getWorkerQueueNames({ EXPORT_RETENTION_QUEUE_ENABLED: "true", WORKER_QUEUE_GROUP: "general" })).toEqual([
|
||||
queueNames.notifications,
|
||||
queueNames.maintenance,
|
||||
queueNames.fileScan,
|
||||
queueNames.filePreview,
|
||||
]);
|
||||
expect(vi.mocked(createWorkerImpl).mock.calls.map(([queueName]) => queueName)).toEqual(runtime.queueNames);
|
||||
});
|
||||
@@ -481,7 +481,7 @@ describe("worker runtime", () => {
|
||||
const reporter: ErrorReporter = { report: vi.fn() };
|
||||
const emailWorker = createMockWorker(queueNames.email);
|
||||
const notificationWorker = createMockWorker(queueNames.notifications, vi.fn(async () => { throw closeError; }));
|
||||
await expect(shutdownWorkerRuntime({ workers: [emailWorker, notificationWorker] }, { logger, reason: "SIGTERM", reporter })).rejects.toThrow("Failed to close workers: toolctrl.notifications.");
|
||||
await expect(shutdownWorkerRuntime({ workers: [emailWorker, notificationWorker] }, { logger, reason: "SIGTERM", reporter })).rejects.toThrow("Failed to close workers: hivegrid.notifications.");
|
||||
expect(logger.error).toHaveBeenCalledWith({ error: expect.objectContaining({ message: "close failed" }), reason: "SIGTERM", workerName: queueNames.notifications }, "Failed to close worker.");
|
||||
expect(reporter.report).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
@@ -514,7 +514,7 @@ describe("worker runtime", () => {
|
||||
|
||||
expect(recordFailedJob).not.toHaveBeenCalled();
|
||||
const closingWorker = createMockWorker(queueNames.email, vi.fn(async () => { throw new Error("close failed"); }));
|
||||
await expect(shutdownWorkerRuntime({ workers: [closingWorker] }, { logger, reporter })).rejects.toThrow("Failed to close workers: toolctrl.email.");
|
||||
await expect(shutdownWorkerRuntime({ workers: [closingWorker] }, { logger, reporter })).rejects.toThrow("Failed to close workers: hivegrid.email.");
|
||||
});
|
||||
|
||||
test("wraps each job in a Sentry queue.process span with queue/job/tenant tags", async () => {
|
||||
@@ -561,7 +561,7 @@ describe("worker runtime", () => {
|
||||
expect(spans[0].args.attributes?.["messaging.bullmq.job.name"]).toBe("deliver-webhook");
|
||||
expect(spans[0].args.attributes?.["messaging.bullmq.attempts_made"]).toBe(0);
|
||||
expect(spans[0].args.attributes?.["messaging.bullmq.attempts_limit"]).toBe(3);
|
||||
expect(spans[0].args.attributes?.["toolctrl.tenant_id"]).toBe("tnt_42");
|
||||
expect(spans[0].args.attributes?.["hivegrid.tenant_id"]).toBe("tnt_42");
|
||||
expect(spans[0].status?.code).toBe(1);
|
||||
expect(captureException).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user