@@ -73,6 +73,7 @@ async function generateReport(artifactsRootPath: string) {
73
73
const reportsData = await Promise . all (
74
74
foundDirectories . map ( async ( dirName ) => {
75
75
const fullPath = join ( artifactsRootPath , dirName ) ;
76
+ console . log ( `Processing directory: ${ fullPath } ` ) ;
76
77
const jsonSummaryFilePath = join ( fullPath , "./k6_summary.json" ) ;
77
78
78
79
if ( ! existsSync ( jsonSummaryFilePath ) ) {
@@ -135,6 +136,8 @@ async function generateReport(artifactsRootPath: string) {
135
136
. filter ( notEmpty )
136
137
. sort ( ( a , b ) => b . rps - a . rps ) ;
137
138
139
+ console . log ( `Found ${ validReportsData . length } valid reports` ) ;
140
+
138
141
const vega : vl . TopLevelSpec = {
139
142
width : 600 ,
140
143
height : 400 ,
@@ -196,7 +199,10 @@ async function generateReport(artifactsRootPath: string) {
196
199
) ;
197
200
}
198
201
199
- const checks = v . jsonSummary . root_group . checks ;
202
+ const checks : Array < {
203
+ fails : number ;
204
+ name : string ;
205
+ } > = v . jsonSummary . root_group . checks ;
200
206
const http200Check = checks . find (
201
207
( c ) => c . name === "response code was 200"
202
208
) ;
@@ -207,6 +213,28 @@ async function generateReport(artifactsRootPath: string) {
207
213
( c ) => c . name === "valid response structure"
208
214
) ;
209
215
216
+ function logRawReport ( ) {
217
+ console . log ( "Raw report for:" , v . name ) ;
218
+ console . log ( "--" ) ;
219
+ console . log ( JSON . stringify ( checks , null , 2 ) ) ;
220
+ console . log ( "--" ) ;
221
+ }
222
+
223
+ if ( ! http200Check ) {
224
+ logRawReport ( ) ;
225
+ throw new Error ( "Could not find 'response code was 200' check!" ) ;
226
+ }
227
+
228
+ if ( ! graphqlErrors ) {
229
+ logRawReport ( ) ;
230
+ throw new Error ( "Could not find 'no graphql errors' check!" ) ;
231
+ }
232
+
233
+ if ( ! responseStructure ) {
234
+ logRawReport ( ) ;
235
+ throw new Error ( "Could not find 'valid response structure' check!" ) ;
236
+ }
237
+
210
238
if ( http200Check . fails > 0 ) {
211
239
notes . push ( `${ http200Check . fails } non-200 responses` ) ;
212
240
}
0 commit comments