ReviewOS

also looking at this

stacks/drone

fix: separate native runtime builds from test deadlines

#69
Merged chris wants to merge codex/runtime-cold-build-setup into main
10 files +399 -14
tests/unit/runtime-build.test.tsadded+15-0
Changes to tests/unit/runtime-build.test.ts
@@ -0,0 +1,15 @@
1import { expect, test } from 'bun:test'
2import { mkdtemp, mkdir, rm, writeFile } from 'node:fs/promises'
3import { tmpdir } from 'node:os'
4import { join } from 'node:path'
5import { buildRuntime } from '../../resources/functions/drone/runtime/build'
6
7test('actual CMake refusal identifies the build stage before any runtime test starts', async () => {
8 const project = await mkdtemp(join(tmpdir(), 'drone-build-refusal-'))
9 try {
10 await mkdir(join(project, 'firmware/runtime'), { recursive: true })
11 await writeFile(join(project, 'firmware/runtime/CMakeLists.txt'), 'cmake_minimum_required(VERSION 3.20)\nproject(controlled_refusal NONE)\nmessage(FATAL_ERROR "Controlled configure refusal")\n')
12 await expect(buildRuntime({ project })).rejects.toThrow('Runtime build host configure: cmake exited 1')
13 }
14 finally { await rm(project, { recursive: true, force: true }) }
15}, 10000)