fix(plugin): harden kubernetes sandbox orchestration

This commit is contained in:
Dotta
2026-05-12 12:25:49 -05:00
committed by Chris Farhood
parent 163e3ca1a5
commit e691d30d12
7 changed files with 233 additions and 37 deletions
@@ -1,4 +1,4 @@
import { describe, it, expect } from "vitest";
import { describe, it, expect, vi } from "vitest";
import { deriveCompanySlug, deriveNamespaceName, newRunUlidDns, paperclipLabels } from "../../src/utils.js";
describe("deriveCompanySlug", () => {
@@ -28,6 +28,13 @@ describe("newRunUlidDns", () => {
const id = newRunUlidDns();
expect(id).toMatch(/^[a-z0-9]{26}$/);
});
it("does not use Math.random for the random suffix", () => {
const spy = vi.spyOn(Math, "random");
newRunUlidDns(() => 1);
expect(spy).not.toHaveBeenCalled();
spy.mockRestore();
});
});
describe("paperclipLabels", () => {