-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
96 lines (87 loc) · 2.5 KB
/
Copy pathtypes.ts
File metadata and controls
96 lines (87 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
export type ApiFormat = "json" | "xml";
export type HttpMethod = "GET";
export type RunProfileName = "Fast" | "Deep";
export type PointState = "queued" | "active" | "passed" | "failed" | "blocked";
export type ServiceKind = "production" | "candidate";
export type ServiceMode = "manual" | "auto";
export type ServiceAvailability = "unknown" | "starting" | "available" | "unavailable";
export interface FixturePoint {
id: string;
category: "capital" | "near-capital" | "country" | "ocean" | "pole" | "contract";
label: string;
lat: number;
lon: number;
territory?: string;
source: string;
}
export interface RequestCase {
id: string;
fixtureId?: string;
method: HttpMethod;
path: string;
query?: Record<string, string>;
format: ApiFormat;
expectation: "parity" | "version-shape" | "roundtrip" | "contract-error";
}
export interface ServiceResponse {
service: ServiceKind;
status: number;
contentType: string;
body: string;
canonical?: CanonicalValue;
}
export interface ServiceStatus {
kind: ServiceKind;
label: string;
mode: ServiceMode;
baseUrl: string;
sourcePath: string;
availability: ServiceAvailability;
logs: string[];
}
export type CanonicalValue =
| null
| boolean
| number
| string
| CanonicalValue[]
| { [key: string]: CanonicalValue };
export interface SemanticDiff {
path: string;
expected: CanonicalValue | undefined;
actual: CanonicalValue | undefined;
message: string;
}
export interface Discrepancy {
id: string;
caseId: string;
fixtureId?: string;
endpoint: string;
format: ApiFormat;
status: "discrepancy" | "oracle-error" | "infrastructure-error";
summary: string;
diffs: SemanticDiff[];
production: ServiceResponse;
candidate: ServiceResponse;
replay: string;
logExcerpt?: string[];
}
export interface RunSummary {
runId: string;
profile: RunProfileName;
seed: number;
totalCases: number;
completedCases: number;
failures: number;
roundTrips: number;
currentRequestsPerSecond: number;
averageRequestsPerSecond: number;
}
export type RunnerEvent =
| { type: "run-summary"; summary: RunSummary }
| { type: "point-state"; fixtureId: string; state: PointState }
| { type: "current-case"; production?: ServiceResponse; candidate?: ServiceResponse; request: RequestCase }
| { type: "discrepancy"; discrepancy: Discrepancy }
| { type: "service-log"; service: ServiceKind; line: string }
| { type: "service-status"; services: Record<ServiceKind, ServiceStatus> }
| { type: "run-complete"; summary: RunSummary };