@@ -2,6 +2,7 @@ package monitortestframework
22
33import (
44 "context"
5+ "errors"
56 "fmt"
67 "os"
78 "strings"
@@ -94,6 +95,17 @@ func (r *monitorTestRegistry) StartCollection(ctx context.Context, adminRESTConf
9495 end := time .Now ()
9596 duration := end .Sub (start )
9697 if err != nil {
98+ var nsErr * NotSupportedError
99+ if errors .As (err , & nsErr ) {
100+ junitCh <- & junitapi.JUnitTestCase {
101+ Name : testName ,
102+ Duration : duration .Seconds (),
103+ SkipMessage : & junitapi.SkipMessage {
104+ Message : nsErr .Reason ,
105+ },
106+ }
107+ return
108+ }
97109 errCh <- err
98110 junitCh <- & junitapi.JUnitTestCase {
99111 Name : testName ,
@@ -149,6 +161,19 @@ func (r *monitorTestRegistry) CollectData(ctx context.Context, storageDir string
149161 end := time .Now ()
150162 duration := end .Sub (start )
151163 if err != nil {
164+ var nsErr * NotSupportedError
165+ if errors .As (err , & nsErr ) {
166+ junitCh <- []* junitapi.JUnitTestCase {
167+ {
168+ Name : testName ,
169+ Duration : duration .Seconds (),
170+ SkipMessage : & junitapi.SkipMessage {
171+ Message : nsErr .Reason ,
172+ },
173+ },
174+ }
175+ return
176+ }
152177 junitCh <- []* junitapi.JUnitTestCase {
153178 {
154179 Name : testName ,
@@ -206,6 +231,18 @@ func (r *monitorTestRegistry) ConstructComputedIntervals(ctx context.Context, st
206231 end := time .Now ()
207232 duration := end .Sub (start )
208233 if err != nil {
234+ var nsErr * NotSupportedError
235+ if errors .As (err , & nsErr ) {
236+ junits = append (junits , & junitapi.JUnitTestCase {
237+ Name : testName ,
238+ Duration : duration .Seconds (),
239+ SkipMessage : & junitapi.SkipMessage {
240+ Message : nsErr .Reason ,
241+ },
242+ })
243+ continue
244+ }
245+
209246 errs = append (errs , err )
210247 junits = append (junits , & junitapi.JUnitTestCase {
211248 Name : testName ,
@@ -240,6 +277,18 @@ func (r *monitorTestRegistry) EvaluateTestsFromConstructedIntervals(ctx context.
240277 end := time .Now ()
241278 duration := end .Sub (start )
242279 if err != nil {
280+ var nsErr * NotSupportedError
281+ if errors .As (err , & nsErr ) {
282+ junits = append (junits , & junitapi.JUnitTestCase {
283+ Name : testName ,
284+ Duration : duration .Seconds (),
285+ SkipMessage : & junitapi.SkipMessage {
286+ Message : nsErr .Reason ,
287+ },
288+ })
289+ continue
290+ }
291+
243292 errs = append (errs , err )
244293 junits = append (junits , & junitapi.JUnitTestCase {
245294 Name : testName ,
@@ -282,6 +331,18 @@ func (r *monitorTestRegistry) WriteContentToStorage(ctx context.Context, storage
282331 end := time .Now ()
283332 duration := end .Sub (start )
284333 if err != nil {
334+ var nsErr * NotSupportedError
335+ if errors .As (err , & nsErr ) {
336+ junits = append (junits , & junitapi.JUnitTestCase {
337+ Name : testName ,
338+ Duration : duration .Seconds (),
339+ SkipMessage : & junitapi.SkipMessage {
340+ Message : nsErr .Reason ,
341+ },
342+ })
343+ continue
344+ }
345+
285346 errs = append (errs , err )
286347 junits = append (junits , & junitapi.JUnitTestCase {
287348 Name : testName ,
@@ -315,6 +376,18 @@ func (r *monitorTestRegistry) Cleanup(ctx context.Context) ([]*junitapi.JUnitTes
315376 end := time .Now ()
316377 duration := end .Sub (start )
317378 if err != nil {
379+ var nsErr * NotSupportedError
380+ if errors .As (err , & nsErr ) {
381+ junits = append (junits , & junitapi.JUnitTestCase {
382+ Name : testName ,
383+ Duration : duration .Seconds (),
384+ SkipMessage : & junitapi.SkipMessage {
385+ Message : nsErr .Reason ,
386+ },
387+ })
388+ continue
389+ }
390+
318391 errs = append (errs , err )
319392 junits = append (junits , & junitapi.JUnitTestCase {
320393 Name : testName ,
0 commit comments