@@ -3,8 +3,8 @@ import indentString from 'indent-string'
33
44import { TestResultsShortLinks } from '../rest/test-sessions'
55import { Reporter } from './reporter'
6- import { CheckStatus , formatCheckTitle , getTestSessionUrl , printLn } from './util'
7- import type { SequenceId , RunLocation } from '../services/abstract-check-runner'
6+ import { CheckStatus , formatCheckTitle , getTestSessionUrl , printLn , resultToCheckStatus } from './util'
7+ import type { RunLocation , SequenceId } from '../services/abstract-check-runner'
88import { Check } from '../constructs/check'
99import { testSessions } from '../rest/api'
1010
@@ -86,7 +86,7 @@ export default abstract class AbstractListReporter implements Reporter {
8686 checkStatus . result = checkResult
8787 checkStatus . links = links
8888 checkStatus . testResultId = testResultId
89- checkStatus . checkStatus = checkResult . hasFailures ? CheckStatus . FAILED : CheckStatus . SUCCESSFUL
89+ checkStatus . checkStatus = resultToCheckStatus ( checkResult )
9090 checkStatus . titleString = formatCheckTitle ( checkStatus . checkStatus , checkResult , {
9191 includeSourceFile : false ,
9292 } )
@@ -104,7 +104,7 @@ export default abstract class AbstractListReporter implements Reporter {
104104 }
105105
106106 _printSummary ( opts : { skipCheckCount ?: boolean } = { } ) {
107- const counts = { numFailed : 0 , numPassed : 0 , numRunning : 0 , numRetrying : 0 , scheduling : 0 }
107+ const counts = { numFailed : 0 , numPassed : 0 , numDegraded : 0 , numRunning : 0 , numRetrying : 0 , scheduling : 0 }
108108 const status = [ ]
109109 if ( this . checkFilesMap ! . size === 1 && this . checkFilesMap ! . has ( undefined ) ) {
110110 status . push ( chalk . bold ( 'Summary:' ) )
@@ -120,6 +120,8 @@ export default abstract class AbstractListReporter implements Reporter {
120120 counts . numRunning ++
121121 } else if ( result . hasFailures ) {
122122 counts . numFailed ++
123+ } else if ( result . isDegraded ) {
124+ counts . numDegraded ++
123125 } else {
124126 counts . numPassed ++
125127 }
@@ -134,6 +136,7 @@ export default abstract class AbstractListReporter implements Reporter {
134136 counts . numRunning ? chalk . bold . magenta ( `${ counts . numRunning } running` ) : undefined ,
135137 counts . numRetrying ? chalk . bold ( `${ counts . numRetrying } retrying` ) : undefined ,
136138 counts . numFailed ? chalk . bold . red ( `${ counts . numFailed } failed` ) : undefined ,
139+ counts . numDegraded ? chalk . bold . yellow ( `${ counts . numDegraded } degraded` ) : undefined ,
137140 counts . numPassed ? chalk . bold . green ( `${ counts . numPassed } passed` ) : undefined ,
138141 `${ this . numChecks } total` ,
139142 ] . filter ( Boolean ) . join ( ', ' ) )
@@ -153,14 +156,16 @@ export default abstract class AbstractListReporter implements Reporter {
153156 }
154157
155158 _printBriefSummary ( ) {
156- const counts = { numFailed : 0 , numPassed : 0 , numPending : 0 }
159+ const counts = { numFailed : 0 , numDegraded : 0 , numPassed : 0 , numPending : 0 }
157160 const status = [ ]
158161 for ( const [ , checkMap ] of this . checkFilesMap ! . entries ( ) ) {
159162 for ( const [ _ , { result } ] of checkMap . entries ( ) ) {
160163 if ( ! result ) {
161164 counts . numPending ++
162165 } else if ( result . hasFailures ) {
163166 counts . numFailed ++
167+ } else if ( result . isDegraded ) {
168+ counts . numDegraded ++
164169 } else {
165170 counts . numPassed ++
166171 }
@@ -169,6 +174,7 @@ export default abstract class AbstractListReporter implements Reporter {
169174 status . push ( '' )
170175 status . push ( [
171176 counts . numFailed ? chalk . bold . red ( `${ counts . numFailed } failed` ) : undefined ,
177+ counts . numDegraded ? chalk . bold . yellow ( `${ counts . numDegraded } degraded` ) : undefined ,
172178 counts . numPassed ? chalk . bold . green ( `${ counts . numPassed } passed` ) : undefined ,
173179 counts . numPending ? chalk . bold . magenta ( `${ counts . numPending } pending` ) : undefined ,
174180 `${ this . numChecks } total` ,
0 commit comments