@@ -794,7 +794,7 @@ class CITGMBuild extends TestBuild {
794794 return this . failures ;
795795 }
796796
797- this . results = this . parseResults ( resultData . childReports ) ;
797+ this . results = this . parseResults ( resultData ) ;
798798
799799 // Update id again so that it correctly displays in Summary output.
800800 this . path = `job/citgm-smoker/${ id } /` ;
@@ -803,9 +803,16 @@ class CITGMBuild extends TestBuild {
803803 }
804804
805805 parseResults ( data ) {
806- const results = { all : { } , failures : { } } ;
806+ const { childReports, totalCount, skipCount, failCount } = data ;
807+ const results = { all : { } , failures : { } , statistics : { } } ;
807808
808- data . forEach ( platform => {
809+ const passCount = totalCount - failCount - skipCount ;
810+ results . statistics [ 'passed' ] = passCount ;
811+ results . statistics [ 'total' ] = totalCount ;
812+ results . statistics [ 'skipped' ] = skipCount ;
813+ results . statistics [ 'failed' ] = failCount ;
814+
815+ childReports . forEach ( platform => {
809816 const cases = flatten ( platform . result . suites [ 0 ] . cases ) ;
810817 const url = platform . child . url ;
811818 const nodeName = getNodeName ( url ) ;
@@ -821,6 +828,15 @@ class CITGMBuild extends TestBuild {
821828
822829 displayBuilds ( ) {
823830 const { cli, results } = this ;
831+ const { failed, skipped, passed, total } = results . statistics ;
832+
833+ cli . separator ( 'Statistics' ) ;
834+ console . table ( {
835+ 'Failed' : failed ,
836+ 'Skipped' : skipped ,
837+ 'Passed' : passed ,
838+ 'Total' : total
839+ } ) ;
824840
825841 cli . separator ( 'Failures' ) ;
826842 const output = { } ;
@@ -840,20 +856,32 @@ class CITGMBuild extends TestBuild {
840856 const result = {
841857 source : sourceURL ,
842858 upstream : jobUrl ,
859+ ...results . statistics ,
843860 ...results . failures
844861 } ;
845862
846863 return JSON . parse ( JSON . stringify ( result ) ) ;
847864 }
848865
849866 formatAsMarkdown ( ) {
850- const { jobUrl, result, results } = this ;
867+ const { jobUrl, result, results, id } = this ;
868+
869+ let output = `# CITGM Data for [${ id } ](${ jobUrl } )\n\n` ;
870+
871+ const { failed, skipped, passed, total } = results . statistics ;
872+
873+ output += `## Statistics for job [${ id } ](${ jobUrl } )\n\n` ;
874+ output += '| FAILED | SKIPPED | PASSED | TOTAL |\n' ;
875+ output += '| -------- | --------- | -------- | ------- |\n' ;
876+ output += `| ${ pad ( failed , 8 ) } | ${ pad ( skipped , 9 ) } |` ;
877+ output += ` ${ pad ( passed , 8 ) } | ${ pad ( total , 7 ) } |\n\n` ;
851878
852879 if ( result === SUCCESS ) {
853- return `Job ${ jobUrl } is green.` ;
880+ output += `Job [${ id } ](${ jobUrl } ) is green.` ;
881+ return output ;
854882 }
855883
856- let output = `Failures in job ${ jobUrl } \n\n` ;
884+ output + = `## Failures in job [ ${ id } ]( ${ jobUrl } ) \n\n` ;
857885 for ( const failure in results . failures ) {
858886 const data = results . failures [ failure ] ;
859887 output += `### [${ failure } ](${ data . url } )\n\n` ;
0 commit comments