Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(e2e): cover the exact fixture storage guard in cleanup recovery

Alfredo Lopezbbe64f7a14e3
diff --git a/scripts/e2e/approved-tools-control-api-lifecycle.test.mjs b/scripts/e2e/approved-tools-control-api-lifecycle.test.mjs
index f5115d72d..0764cd3c1 100644
--- a/scripts/e2e/approved-tools-control-api-lifecycle.test.mjs
+++ b/scripts/e2e/approved-tools-control-api-lifecycle.test.mjs
@@ -445,3 +445,48 @@ test('recovery refuses changed original deployment, foreign run and unfinished r
assert.deepEqual(calls, [])
}
})
+test('recovery accepts only the exact fixture /tmp storage on a live fixture deployment', async () => {
+ const recover = async live => {
+ const calls = []
+ const result = recoverControlApiForCleanup({
+ state: recoveryState(),
+ profile,
+ get: () => {
+ calls.push('get')
+ return live
+ },
+ patch: () => calls.push('patch'),
+ wait: () => calls.push('wait'),
+ verify: () => calls.push('verify'),
+ })
+ return { result, calls }
+ }
+ const exact = await recover(fixture())
+ assert.equal(await exact.result, true)
+ assert.deepEqual(exact.calls, ['get', 'wait', 'verify'])
+ for (const mutate of [
+ d => {
+ d.spec.template.spec.volumes = [{ name: controlApiFixtureVolume, hostPath: { path: '/' } }]
+ },
+ d => {
+ d.spec.template.spec.volumes.push({ name: controlApiFixtureVolume, emptyDir: {} })
+ },
+ d => {
+ delete d.spec.template.spec.volumes
+ },
+ d => {
+ d.spec.template.spec.containers[0].volumeMounts = [
+ { name: 'other', mountPath: controlApiFixtureMountPath },
+ ]
+ },
+ d => {
+ delete d.spec.template.spec.containers[0].volumeMounts
+ },
+ ]) {
+ const live = fixture()
+ mutate(live)
+ const { result, calls } = await recover(live)
+ await assert.rejects(result, /Control API fixture environment changed/)
+ assert.deepEqual(calls, ['get'])
+ }
+})