also looking at this
fix: separate native runtime builds from test deadlines
#69
10 files
+399
-14
| @@ -0,0 +1,15 @@ | ||
| 1 | import { expect, test } from 'bun:test' | |
| 2 | import { mkdtemp, mkdir, rm, writeFile } from 'node:fs/promises' | |
| 3 | import { tmpdir } from 'node:os' | |
| 4 | import { join } from 'node:path' | |
| 5 | import { buildRuntime } from '../../resources/functions/drone/runtime/build' | |
| 6 | ||
| 7 | test('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) | |