Add deterministic tests
This commit is contained in:
parent
6fbbd1e12f
commit
0ce82353e0
20 changed files with 1780 additions and 0 deletions
32
frontend/deterministic-tests/src/test-definition.ts
Normal file
32
frontend/deterministic-tests/src/test-definition.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
export interface ClientState {
|
||||
files: Map<string, string>;
|
||||
}
|
||||
|
||||
export type TestStep =
|
||||
| { type: "create"; client: number; path: string; content: string }
|
||||
| { type: "update"; client: number; path: string; content: string }
|
||||
| { type: "rename"; client: number; oldPath: string; newPath: string }
|
||||
| { type: "delete"; client: number; path: string }
|
||||
| { type: "sync"; client?: number }
|
||||
| { type: "disable-sync"; client: number }
|
||||
| { type: "enable-sync"; client: number }
|
||||
| { type: "pause-server" }
|
||||
| { type: "resume-server" }
|
||||
| { type: "barrier" }
|
||||
| { type: "assert-content"; client: number; path: string; content: string }
|
||||
| { type: "assert-exists"; client: number; path: string }
|
||||
| { type: "assert-not-exists"; client: number; path: string }
|
||||
| { type: "assert-consistent"; verify?: (state: ClientState) => void };
|
||||
|
||||
export interface TestDefinition {
|
||||
name: string;
|
||||
description?: string;
|
||||
clients: number;
|
||||
steps: TestStep[];
|
||||
}
|
||||
|
||||
export interface TestResult {
|
||||
success: boolean;
|
||||
error?: string;
|
||||
duration?: number;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue