@@ -151,7 +151,7 @@ export class TestControllerManager {
151
151
public readonly debugManager : DebugManager ,
152
152
public readonly outputChannel : vscode . OutputChannel ,
153
153
) {
154
- this . testController = vscode . tests . createTestController ( "robotCode.RobotFramework" , "RobotFramework " ) ;
154
+ this . testController = vscode . tests . createTestController ( "robotCode.RobotFramework" , "Robot Framework " ) ;
155
155
156
156
this . testController . resolveHandler = async ( item ) => {
157
157
await this . refresh ( item ) ;
@@ -264,7 +264,6 @@ export class TestControllerManager {
264
264
this . TestRunExited ( event . session . configuration . runId ) ;
265
265
break ;
266
266
}
267
-
268
267
case "robotStarted" : {
269
268
this . OnRobotStartedEvent ( event . session . configuration . runId , event . body as RobotExecutionEvent ) ;
270
269
break ;
@@ -273,6 +272,10 @@ export class TestControllerManager {
273
272
this . OnRobotEndedEvent ( event . session . configuration . runId , event . body as RobotExecutionEvent ) ;
274
273
break ;
275
274
}
275
+ case "robotSetFailed" : {
276
+ this . OnRobotSetFailed ( event . session . configuration . runId , event . body as RobotExecutionEvent ) ;
277
+ break ;
278
+ }
276
279
case "robotEnqueued" : {
277
280
this . TestItemEnqueued ( event . session . configuration . runId , event . body ?. items ) ;
278
281
break ;
@@ -1202,20 +1205,64 @@ export class TestControllerManager {
1202
1205
}
1203
1206
}
1204
1207
1208
+ private OnRobotSetFailed ( runId : string | undefined , event : RobotExecutionEvent ) {
1209
+ switch ( event . type ) {
1210
+ case "suite" :
1211
+ case "test" :
1212
+ this . TestItemSetFailed ( runId , event ) ;
1213
+ break ;
1214
+ default :
1215
+ // do nothing
1216
+ break ;
1217
+ }
1218
+ }
1219
+
1220
+ private TestItemSetFailed ( runId : string | undefined , event : RobotExecutionEvent ) {
1221
+ if ( runId === undefined || event . attributes ?. longname === undefined ) return ;
1222
+
1223
+ const run = this . testRuns . get ( runId ) ;
1224
+
1225
+ if ( run !== undefined ) {
1226
+ const item = this . findTestItemById ( event . id ) ;
1227
+ if ( item ) {
1228
+ const message = new vscode . TestMessage ( event . attributes ?. message ?? "" ) ;
1229
+
1230
+ if ( event . attributes . source ) {
1231
+ message . location = new vscode . Location (
1232
+ vscode . Uri . file ( event . attributes . source ) ,
1233
+ new vscode . Range (
1234
+ new vscode . Position ( ( event . attributes . lineno ?? 1 ) - 1 , 0 ) ,
1235
+ new vscode . Position ( event . attributes . lineno ?? 1 , 0 ) ,
1236
+ ) ,
1237
+ ) ;
1238
+ }
1239
+
1240
+ if ( event . attributes . status === "SKIP" ) {
1241
+ run . skipped ( item ) ;
1242
+ } else if ( event . attributes . status === "FAIL" ) {
1243
+ run . failed ( item , message , event . attributes . elapsedtime ) ;
1244
+ } else if ( event . attributes . status === "ERROR" ) {
1245
+ run . errored ( item , message , event . attributes . elapsedtime ) ;
1246
+ }
1247
+ }
1248
+ }
1249
+ }
1250
+
1205
1251
private TestItemEnded ( runId : string | undefined , event : RobotExecutionEvent ) {
1206
1252
if ( runId === undefined || event . attributes ?. longname === undefined ) return ;
1207
1253
1208
1254
const run = this . testRuns . get ( runId ) ;
1209
1255
1210
1256
if ( run !== undefined ) {
1211
1257
const item = this . findTestItemById ( event . id ) ;
1258
+
1212
1259
if ( item !== undefined ) {
1213
1260
switch ( event . attributes . status ) {
1214
1261
case "PASS" :
1215
- run . passed ( item , event . attributes . elapsedtime ) ;
1262
+ if ( ! item ?. canResolveChildren ) run . passed ( item , event . attributes . elapsedtime ) ;
1216
1263
break ;
1217
1264
case "SKIP" :
1218
- run . skipped ( item ) ;
1265
+ if ( ! item ?. canResolveChildren ) run . skipped ( item ) ;
1219
1266
break ;
1220
1267
default :
1221
1268
{
@@ -1256,10 +1303,12 @@ export class TestControllerManager {
1256
1303
messages . push ( message ) ;
1257
1304
}
1258
1305
1259
- if ( event . attributes . status === "FAIL" ) {
1260
- run . failed ( item , messages , event . attributes . elapsedtime ) ;
1261
- } else {
1262
- run . errored ( item , messages , event . attributes . elapsedtime ) ;
1306
+ if ( ! item ?. canResolveChildren ) {
1307
+ if ( event . attributes . status === "FAIL" ) {
1308
+ run . failed ( item , messages , event . attributes . elapsedtime ) ;
1309
+ } else {
1310
+ run . errored ( item , messages , event . attributes . elapsedtime ) ;
1311
+ }
1263
1312
}
1264
1313
}
1265
1314
break ;
0 commit comments