From 524ea6a41e1e4eaa280df747547643b63ef003e2 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 25 Nov 2026 07:24:40 +0200 Subject: [PATCH] Tests: the cpu-exec wiring guard reads the entrypoint's named programs. af2d29b293 gave each cpuExecPlan() call of the Docker entrypoint the caller's own name for the program ({ ...cpuOptions(), name: 'FerretDB' } and 'WeKan (node)'), so its messages name no path from the environment, and the guard still looked for the bare cpuOptions() call. It now pins both calls with their names. Thanks to xet7 ! --- tests/cpuExecWiring.test.cjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/cpuExecWiring.test.cjs b/tests/cpuExecWiring.test.cjs index e1b608857d..2fed5096ae 100644 --- a/tests/cpuExecWiring.test.cjs +++ b/tests/cpuExecWiring.test.cjs @@ -168,7 +168,10 @@ test('the snap runs node (the app and the maintenance page) through cpu-exec', ( test('Docker entrypoint routes ferretdb and node through the cpu-exec decision', () => { assert.ok(/const \[cmd, args\] = cpuExecPlan\(ferretBin, \[/.test(entrypoint), 'FerretDB'); - assert.ok(/cpuExecPlan\(node, \[path\.join\(build, 'main\.js'\)\], cpuOptions\(\)\)/.test(entrypoint), 'node'); + // Each with the caller's own word for the program, which is all cpu-exec's + // messages name (CodeQL js/clear-text-logging: no path from the environment). + assert.ok(/\], \{ \.\.\.cpuOptions\(\), name: 'FerretDB' \}\);/.test(entrypoint), 'FerretDB, by name'); + assert.ok(/cpuExecPlan\(node, \[path\.join\(build, 'main\.js'\)\], \{ \.\.\.cpuOptions\(\), name: 'WeKan \(node\)' \}\)/.test(entrypoint), 'node'); assert.ok(/spec: env\.WEKAN_REQUIRED_CPU_FEATURES/.test(entrypoint), 'the same variable as cpu-exec'); assert.ok(/path\.join\(build, name\)/.test(entrypoint), 'the qemu-user beside the bundle first, after WEKAN_QEMU_USER'); });