Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions packages/modal/test/ci-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,23 +580,26 @@ describe("public Modal benchmark configuration", () => {
}
}, 15_000);

it("rejects malformed-present model selection JSON instead of defaulting or converting it", () => {
// Give each subprocess its own timeout budget on busy CI runners.
it.each([
{ name: "whitespace-only JSON", generation: "70000-1", value: " ", message: /must be valid strict JSON/u },
{
name: "duplicate JSON keys",
generation: "70001-1",
value: '[{"provider":"openai","provider":"anthropic","model":"gpt-5.6-luna","reasoning":"high"}]',
message: /duplicate/iu
}
])("rejects malformed-present model selection: $name", (testCase) => {
const workspace = path.resolve("../..");
for (const [index, testCase] of [
{ value: " ", message: /must be valid strict JSON/u },
{
value: '[{"provider":"openai","provider":"anthropic","model":"gpt-5.6-luna","reasoning":"high"}]',
message: /duplicate/iu
}
].entries()) {
const output = fs.mkdtempSync(path.join(fs.realpathSync(os.tmpdir()), "ultrafuzz-modal-invalid-model-json-"));
const output = fs.mkdtempSync(path.join(fs.realpathSync(os.tmpdir()), "ultrafuzz-modal-invalid-model-json-"));
try {
const result = spawnSync(
process.execPath,
[
path.join(workspace, "scripts/ci/prepare-modal-benchmarks.mjs"),
"d".repeat(40),
"https://github.com/monad-developers/ultrafuzz",
`${70_000 + index}-1`,
testCase.generation,
output,
"smoke"
],
Expand All @@ -609,6 +612,8 @@ describe("public Modal benchmark configuration", () => {
expect(result.status).not.toBe(0);
expect(result.stderr).toMatch(testCase.message);
expect(fs.existsSync(path.join(output, "manifest.json"))).toBe(false);
} finally {
fs.rmSync(output, { recursive: true, force: true });
}
});

Expand Down
16 changes: 7 additions & 9 deletions packages/modal/test/modal-documents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,15 +484,13 @@ describe("Modal strict JSON contract foundation", () => {
);
});

it("validates one exact TypeScript fixture for every root contract", () => {
const fixtures = contractFixtures();
for (const [schemaId, value] of Object.entries(fixtures) as Array<
[ModalContractSchemaId, ModalContractBySchemaId[ModalContractSchemaId]]
>) {
expect(validateModalJsonSchema(schemaId, value)).toMatchObject({ ok: true });
expect(parseModalDocumentValue(schemaId, value)).toBe(value);
expect(parseModalDocumentBytes(schemaId, bytes(value)).value).toEqual(value);
}
// Give each contract's isolated validation its own timeout budget on busy CI runners.
it.each(
Object.entries(contractFixtures()) as Array<[ModalContractSchemaId, ModalContractBySchemaId[ModalContractSchemaId]]>
)("validates one exact TypeScript fixture for root contract %s", (schemaId, value) => {
expect(validateModalJsonSchema(schemaId, value)).toMatchObject({ ok: true });
expect(parseModalDocumentValue(schemaId, value)).toBe(value);
expect(parseModalDocumentBytes(schemaId, bytes(value)).value).toEqual(value);
});

it("pins positive and negative public benchmark bundle v5 schema fixtures", () => {
Expand Down