Skip to content

Commit 3ebdd02

Browse files
committed
undo the "run" prefix on ghost stories and self healing payload
1 parent 97716bd commit 3ebdd02

9 files changed

Lines changed: 114 additions & 114 deletions

File tree

code/addons/vitest/src/vitest-plugin/agent-telemetry-reporter.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ describe('AgentTelemetryReporter', () => {
128128
expect.objectContaining({
129129
agent: { name: 'claude' },
130130
analysis: expect.objectContaining({
131-
runTotal: 3,
132-
runPassed: 2,
133-
runPassedButEmptyRender: 1,
134-
runSuccessRate: 0.67,
135-
runSuccessRateWithoutEmptyRender: 0.33,
136-
runUniqueErrorCount: 1,
131+
total: 3,
132+
passed: 2,
133+
passedButEmptyRender: 1,
134+
successRate: 0.67,
135+
successRateWithoutEmptyRender: 0.33,
136+
uniqueErrorCount: 1,
137137
}),
138138
unhandledErrorCount: 0,
139139
watch: false,
@@ -167,8 +167,8 @@ describe('AgentTelemetryReporter', () => {
167167
'ai-setup-self-healing-scoring',
168168
expect.objectContaining({
169169
analysis: expect.objectContaining({
170-
runTotal: 1,
171-
runPassed: 0,
170+
total: 1,
171+
passed: 0,
172172
cumulativeTotal: 3,
173173
cumulativePassed: 2,
174174
}),
@@ -218,8 +218,8 @@ describe('AgentTelemetryReporter', () => {
218218
'ai-setup-self-healing-scoring',
219219
expect.objectContaining({
220220
analysis: expect.objectContaining({
221-
runTotal: 1,
222-
runPassed: 1,
221+
total: 1,
222+
passed: 1,
223223
}),
224224
}),
225225
expect.anything()
@@ -262,8 +262,8 @@ describe('AgentTelemetryReporter', () => {
262262
expect(secondCall[1]).toEqual(
263263
expect.objectContaining({
264264
analysis: expect.objectContaining({
265-
runTotal: 1,
266-
runPassed: 0,
265+
total: 1,
266+
passed: 0,
267267
}),
268268
})
269269
);

code/core/src/core-server/server-channel/ai-setup-channel.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ describe('initAIAnalyticsChannel', () => {
209209
vi.mocked(mockRunStoryTests.runStoryTests).mockResolvedValue({
210210
duration: 1234,
211211
summary: {
212-
runTotal: 2,
213-
runPassed: 2,
214-
runSuccessRate: 1,
215-
runSuccessRateWithoutEmptyRender: 1,
216-
runCategorizedErrors: {},
217-
runCssCheck: 'not-run',
218-
runUniqueErrorCount: 0,
219-
runPassedButEmptyRender: 0,
212+
total: 2,
213+
passed: 2,
214+
successRate: 1,
215+
successRateWithoutEmptyRender: 1,
216+
categorizedErrors: {},
217+
cssCheck: 'not-run',
218+
uniqueErrorCount: 0,
219+
passedButEmptyRender: 0,
220220
},
221221
} as any);
222222
vi.mocked(mockAiChecklistFlags.getAiSetupRunId).mockResolvedValue('session-B');
@@ -250,7 +250,7 @@ describe('initAIAnalyticsChannel', () => {
250250
testRunDuration: 1234,
251251
}),
252252
runId: 'session-B',
253-
results: expect.objectContaining({ runTotal: 2, runPassed: 2 }),
253+
results: expect.objectContaining({ total: 2, passed: 2 }),
254254
})
255255
);
256256
});

code/core/src/core-server/server-channel/ghost-stories-channel.test.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,14 @@ describe('ghostStoriesChannel', () => {
214214
testRunDuration: expect.any(Number),
215215
},
216216
results: {
217-
runTotal: 2,
218-
runPassed: 2,
219-
runSuccessRate: 1,
220-
runSuccessRateWithoutEmptyRender: 1,
221-
runCategorizedErrors: expect.any(Object),
222-
runCssCheck: 'not-run',
223-
runUniqueErrorCount: 0,
224-
runPassedButEmptyRender: 0,
217+
total: 2,
218+
passed: 2,
219+
successRate: 1,
220+
successRateWithoutEmptyRender: 1,
221+
categorizedErrors: expect.any(Object),
222+
cssCheck: 'not-run',
223+
uniqueErrorCount: 0,
224+
passedButEmptyRender: 0,
225225
},
226226
});
227227
});
@@ -314,14 +314,14 @@ describe('ghostStoriesChannel', () => {
314314
testRunDuration: expect.any(Number),
315315
},
316316
results: expect.objectContaining({
317-
runTotal: 2,
318-
runPassed: 0,
319-
runSuccessRate: 0,
320-
// runCategorizedErrors is an object keyed by error category
321-
runCategorizedErrors: expect.any(Object),
322-
runCssCheck: 'not-run',
323-
runUniqueErrorCount: expect.any(Number),
324-
runPassedButEmptyRender: 0,
317+
total: 2,
318+
passed: 0,
319+
successRate: 0,
320+
// categorizedErrors is an object keyed by error category
321+
categorizedErrors: expect.any(Object),
322+
cssCheck: 'not-run',
323+
uniqueErrorCount: expect.any(Number),
324+
passedButEmptyRender: 0,
325325
}),
326326
})
327327
);

code/core/src/core-server/utils/ghost-stories/parse-vitest-report.test.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ describe('parse-vitest-report', () => {
4242
const result = parseVitestResults(mockVitestResults);
4343

4444
expect(result.summary).toEqual({
45-
runTotal: 3,
46-
runPassed: 3,
47-
runPassedButEmptyRender: 0,
48-
runSuccessRate: 1.0,
49-
runSuccessRateWithoutEmptyRender: 1.0,
50-
runUniqueErrorCount: 0,
51-
runCategorizedErrors: {},
52-
runCssCheck: 'not-run',
45+
total: 3,
46+
passed: 3,
47+
passedButEmptyRender: 0,
48+
successRate: 1.0,
49+
successRateWithoutEmptyRender: 1.0,
50+
uniqueErrorCount: 0,
51+
categorizedErrors: {},
52+
cssCheck: 'not-run',
5353
});
5454
});
5555

@@ -86,10 +86,10 @@ describe('parse-vitest-report', () => {
8686

8787
const result = parseVitestResults(mockVitestResults);
8888

89-
expect(result.summary?.runTotal).toBe(3);
90-
expect(result.summary?.runPassed).toBe(1);
91-
expect(result.summary?.runSuccessRate).toBe(0.33);
92-
expect(result.summary?.runUniqueErrorCount).toBe(2);
89+
expect(result.summary?.total).toBe(3);
90+
expect(result.summary?.passed).toBe(1);
91+
expect(result.summary?.successRate).toBe(0.33);
92+
expect(result.summary?.uniqueErrorCount).toBe(2);
9393
});
9494

9595
it('should categorize errors and include them in the summary', () => {
@@ -137,10 +137,10 @@ describe('parse-vitest-report', () => {
137137

138138
const result = parseVitestResults(mockVitestResults);
139139

140-
expect(result.summary?.runTotal).toBe(5);
141-
expect(result.summary?.runPassed).toBe(1);
142-
expect(result.summary?.runUniqueErrorCount).toBe(3);
143-
expect(result.summary?.runCategorizedErrors).toEqual({
140+
expect(result.summary?.total).toBe(5);
141+
expect(result.summary?.passed).toBe(1);
142+
expect(result.summary?.uniqueErrorCount).toBe(3);
143+
expect(result.summary?.categorizedErrors).toEqual({
144144
HOOK_USAGE_ERROR: {
145145
uniqueCount: 1,
146146
count: 1,
@@ -199,9 +199,9 @@ describe('parse-vitest-report', () => {
199199

200200
const result = parseVitestResults(mockVitestResults);
201201

202-
expect(result.summary?.runPassedButEmptyRender).toBe(2);
203-
expect(result.summary?.runSuccessRate).toBe(1.0);
204-
expect(result.summary?.runSuccessRateWithoutEmptyRender).toBe(0.33);
202+
expect(result.summary?.passedButEmptyRender).toBe(2);
203+
expect(result.summary?.successRate).toBe(1.0);
204+
expect(result.summary?.successRateWithoutEmptyRender).toBe(0.33);
205205
});
206206

207207
it('should handle multiple test suites', () => {
@@ -244,8 +244,8 @@ describe('parse-vitest-report', () => {
244244

245245
const result = parseVitestResults(mockVitestResults);
246246

247-
expect(result.summary?.runTotal).toBe(4);
248-
expect(result.summary?.runPassed).toBe(3);
247+
expect(result.summary?.total).toBe(4);
248+
expect(result.summary?.passed).toBe(3);
249249
});
250250

251251
it('should handle zero total tests', () => {
@@ -259,11 +259,11 @@ describe('parse-vitest-report', () => {
259259

260260
const result = parseVitestResults(mockVitestResults);
261261

262-
expect(result.summary?.runTotal).toBe(0);
263-
expect(result.summary?.runSuccessRate).toBe(0);
262+
expect(result.summary?.total).toBe(0);
263+
expect(result.summary?.successRate).toBe(0);
264264
});
265265

266-
it('surfaces the CssCheck story outcome via summary.runCssCheck', () => {
266+
it('surfaces the CssCheck story outcome via summary.cssCheck', () => {
267267
const mockVitestResults = {
268268
success: false,
269269
numTotalTests: 2,
@@ -291,7 +291,7 @@ describe('parse-vitest-report', () => {
291291

292292
const result = parseVitestResults(mockVitestResults);
293293

294-
expect(result.summary?.runCssCheck).toBe('fail');
294+
expect(result.summary?.cssCheck).toBe('fail');
295295
});
296296
});
297297
});

code/core/src/shared/utils/analyze-test-results.test.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ describe('analyze-test-results', () => {
7070
];
7171
const analysis = analyzeTestResults(results);
7272
expect(analysis).toEqual({
73-
runTotal: 3,
74-
runPassed: 3,
75-
runPassedButEmptyRender: 0,
76-
runSuccessRate: 1.0,
77-
runSuccessRateWithoutEmptyRender: 1.0,
78-
runUniqueErrorCount: 0,
79-
runCategorizedErrors: {},
80-
runCssCheck: 'not-run',
73+
total: 3,
74+
passed: 3,
75+
passedButEmptyRender: 0,
76+
successRate: 1.0,
77+
successRateWithoutEmptyRender: 1.0,
78+
uniqueErrorCount: 0,
79+
categorizedErrors: {},
80+
cssCheck: 'not-run',
8181
});
8282
});
8383

@@ -88,10 +88,10 @@ describe('analyze-test-results', () => {
8888
{ storyId: 's3', status: 'FAIL', error: 'Error: Module not found', stack: '' },
8989
];
9090
const analysis = analyzeTestResults(results);
91-
expect(analysis.runTotal).toBe(3);
92-
expect(analysis.runPassed).toBe(1);
93-
expect(analysis.runSuccessRate).toBe(0.33);
94-
expect(analysis.runUniqueErrorCount).toBe(2);
91+
expect(analysis.total).toBe(3);
92+
expect(analysis.passed).toBe(1);
93+
expect(analysis.successRate).toBe(0.33);
94+
expect(analysis.uniqueErrorCount).toBe(2);
9595
});
9696

9797
it('should count passedButEmptyRender', () => {
@@ -101,16 +101,16 @@ describe('analyze-test-results', () => {
101101
{ storyId: 's3', status: 'PASS', emptyRender: true },
102102
];
103103
const analysis = analyzeTestResults(results);
104-
expect(analysis.runPassedButEmptyRender).toBe(2);
105-
expect(analysis.runSuccessRate).toBe(1.0);
106-
expect(analysis.runSuccessRateWithoutEmptyRender).toBe(0.33);
104+
expect(analysis.passedButEmptyRender).toBe(2);
105+
expect(analysis.successRate).toBe(1.0);
106+
expect(analysis.successRateWithoutEmptyRender).toBe(0.33);
107107
});
108108

109109
it('should handle zero tests', () => {
110110
const analysis = analyzeTestResults([]);
111-
expect(analysis.runTotal).toBe(0);
112-
expect(analysis.runSuccessRate).toBe(0);
113-
expect(analysis.runSuccessRateWithoutEmptyRender).toBe(0);
111+
expect(analysis.total).toBe(0);
112+
expect(analysis.successRate).toBe(0);
113+
expect(analysis.successRateWithoutEmptyRender).toBe(0);
114114
expect(analysis.cumulativeTotal).toBeUndefined();
115115
});
116116

@@ -120,9 +120,9 @@ describe('analyze-test-results', () => {
120120
{ storyId: 's2', status: 'PENDING' },
121121
];
122122
const analysis = analyzeTestResults(results);
123-
expect(analysis.runTotal).toBe(2);
124-
expect(analysis.runPassed).toBe(1);
125-
expect(analysis.runSuccessRate).toBe(0.5);
123+
expect(analysis.total).toBe(2);
124+
expect(analysis.passed).toBe(1);
125+
expect(analysis.successRate).toBe(0.5);
126126
});
127127

128128
describe('cumulative stats', () => {
@@ -154,8 +154,8 @@ describe('analyze-test-results', () => {
154154
{ storyId: 's5', status: 'PASS' },
155155
];
156156
const analysis = analyzeTestResults(run, cumulative);
157-
expect(analysis.runTotal).toBe(3);
158-
expect(analysis.runPassed).toBe(0);
157+
expect(analysis.total).toBe(3);
158+
expect(analysis.passed).toBe(0);
159159
expect(analysis.cumulativeTotal).toBe(5);
160160
expect(analysis.cumulativePassed).toBe(4);
161161
expect(analysis.cumulativeSuccessRate).toBe(0.8);
@@ -168,7 +168,7 @@ describe('analyze-test-results', () => {
168168
{ storyId: 'components-button--primary', status: 'PASS' },
169169
{ storyId: 'components-button--css-check', status: 'PASS' },
170170
];
171-
expect(analyzeTestResults(results).runCssCheck).toBe('pass');
171+
expect(analyzeTestResults(results).cssCheck).toBe('pass');
172172
});
173173

174174
it("is 'fail' when a --css-check story failed", () => {
@@ -179,14 +179,14 @@ describe('analyze-test-results', () => {
179179
error: 'expected rgb(37, 99, 235) but got rgba(0, 0, 0, 0)',
180180
},
181181
];
182-
expect(analyzeTestResults(results).runCssCheck).toBe('fail');
182+
expect(analyzeTestResults(results).cssCheck).toBe('fail');
183183
});
184184

185185
it("is 'not-run' when no --css-check story is present", () => {
186186
const results: StoryTestResult[] = [
187187
{ storyId: 'components-button--primary', status: 'PASS' },
188188
];
189-
expect(analyzeTestResults(results).runCssCheck).toBe('not-run');
189+
expect(analyzeTestResults(results).cssCheck).toBe('not-run');
190190
});
191191

192192
it("is 'not-run' when the --css-check story was skipped / pending / todo", () => {
@@ -196,11 +196,11 @@ describe('analyze-test-results', () => {
196196
const results: StoryTestResult[] = [
197197
{ storyId: 'components-button--css-check', status: 'PENDING' },
198198
];
199-
expect(analyzeTestResults(results).runCssCheck).toBe('not-run');
199+
expect(analyzeTestResults(results).cssCheck).toBe('not-run');
200200
});
201201

202202
it("is 'not-run' for an empty result list", () => {
203-
expect(analyzeTestResults([]).runCssCheck).toBe('not-run');
203+
expect(analyzeTestResults([]).cssCheck).toBe('not-run');
204204
});
205205

206206
it('uses the first match when multiple --css-check stories exist', () => {
@@ -210,7 +210,7 @@ describe('analyze-test-results', () => {
210210
{ storyId: 'components-button--css-check', status: 'PASS' },
211211
{ storyId: 'components-card--css-check', status: 'FAIL', error: 'style mismatch' },
212212
];
213-
expect(analyzeTestResults(results).runCssCheck).toBe('pass');
213+
expect(analyzeTestResults(results).cssCheck).toBe('pass');
214214
});
215215

216216
it('is case-insensitive on the suffix (defensive)', () => {
@@ -219,7 +219,7 @@ describe('analyze-test-results', () => {
219219
const results: StoryTestResult[] = [
220220
{ storyId: 'components-button--CSS-CHECK', status: 'PASS' },
221221
];
222-
expect(analyzeTestResults(results).runCssCheck).toBe('pass');
222+
expect(analyzeTestResults(results).cssCheck).toBe('pass');
223223
});
224224
});
225225
});

0 commit comments

Comments
 (0)