feat(soak): populate scenario + scenario registry
Partitions sessions into N rooms, runs gamesPerRoom games per room in parallel via Promise.allSettled so a failure in one room never unwinds the others. Errors roll up into ScenarioResult.errors. Verified via tsx: listScenarios() returns [populate], getScenario() resolves by name and returns undefined for unknown names. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
22
tests/soak/scenarios/index.ts
Normal file
22
tests/soak/scenarios/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Scenario registry — name → Scenario mapping.
|
||||
*
|
||||
* Runner looks up scenarios by name. Add a new scenario by importing
|
||||
* it here and adding an entry to `registry`. No filesystem scanning,
|
||||
* no magic.
|
||||
*/
|
||||
|
||||
import type { Scenario } from '../core/types';
|
||||
import populate from './populate';
|
||||
|
||||
const registry: Record<string, Scenario> = {
|
||||
populate,
|
||||
};
|
||||
|
||||
export function getScenario(name: string): Scenario | undefined {
|
||||
return registry[name];
|
||||
}
|
||||
|
||||
export function listScenarios(): Scenario[] {
|
||||
return Object.values(registry);
|
||||
}
|
||||
Reference in New Issue
Block a user