mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-19 08:28:06 +02:00
test: close unified ingest v1 expectations
This commit is contained in:
parent
23dba892cd
commit
1180fffdeb
9 changed files with 48 additions and 20 deletions
|
|
@ -153,10 +153,18 @@ function normalizeState(projectDir: string, value: unknown): KtxSetupContextStat
|
|||
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
||||
return notStartedState(projectDir);
|
||||
}
|
||||
const record = value as Partial<KtxSetupContextState>;
|
||||
const rawStatus = record.status ?? 'not_started';
|
||||
const record = value as Record<string, unknown>;
|
||||
const rawStatus = typeof record.status === 'string' ? record.status : 'not_started';
|
||||
const legacyActive = rawStatus === 'detached' || rawStatus === 'paused' || rawStatus === 'running';
|
||||
const status: KtxSetupContextBuildStatus = legacyActive ? 'stale' : rawStatus;
|
||||
const status: KtxSetupContextBuildStatus = legacyActive
|
||||
? 'stale'
|
||||
: rawStatus === 'completed' ||
|
||||
rawStatus === 'failed' ||
|
||||
rawStatus === 'interrupted' ||
|
||||
rawStatus === 'not_started' ||
|
||||
rawStatus === 'stale'
|
||||
? rawStatus
|
||||
: 'not_started';
|
||||
const runId = typeof record.runId === 'string' && record.runId.length > 0 ? record.runId : undefined;
|
||||
return {
|
||||
...(runId ? { runId } : {}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue