feat: add guarded portal canary release
Memind CI / Test, build, and release guards (push) Failing after 2m14s
Memind CI / Test, build, and release guards (push) Failing after 2m14s
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import {
|
||||
isPassiveCanaryRuntime,
|
||||
resolvePortalRuntimeRole,
|
||||
} from './portal-runtime-role.mjs';
|
||||
|
||||
test('runtime role defaults to stable and rejects unknown values', () => {
|
||||
assert.equal(resolvePortalRuntimeRole({}), 'stable');
|
||||
assert.equal(resolvePortalRuntimeRole({ MEMIND_RUNTIME_ROLE: 'unknown' }), 'stable');
|
||||
});
|
||||
|
||||
test('candidate runtime is passive unless explicitly disabled', () => {
|
||||
assert.equal(
|
||||
isPassiveCanaryRuntime({ MEMIND_RUNTIME_ROLE: 'candidate' }),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
isPassiveCanaryRuntime({
|
||||
MEMIND_RUNTIME_ROLE: 'candidate',
|
||||
MEMIND_CANARY_PASSIVE_RUNTIME: '0',
|
||||
}),
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
isPassiveCanaryRuntime({ MEMIND_RUNTIME_ROLE: 'stable' }),
|
||||
false,
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user