File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
components/history/run-comparison Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,14 @@ export class RunComparison extends AbstractViewModel {
100100 pastStatus = pastRun . context . resultStatus ;
101101 }
102102
103- if ( currentStatus === ResultStatusType . PASSED && pastStatus === ResultStatusType . PASSED ) {
103+ if (
104+ ( currentStatus === ResultStatusType . PASSED && pastStatus === ResultStatusType . PASSED )
105+ || pastStatus === ResultStatusType . FAILED_RETRIED
106+ || currentStatus === ResultStatusType . FAILED_RETRIED ) {
104107 return null ;
105108 }
106109
110+
107111 if ( method . runs . length > 1 ) {
108112 methodHistoryAvailable = true ;
109113 }
Original file line number Diff line number Diff line change @@ -229,14 +229,18 @@ export class HistoryStatistics {
229229
230230 clsStat . methods . forEach ( ( method ) => {
231231 let methodHistory = classHistory . methods . find (
232- methodHistoryStatistics => methodHistoryStatistics . identifier === method . identifier && this . _compareRelatedMethods ( methodHistoryStatistics . relatedMethods , method . relatedMethods )
232+ methodHistoryStatistics => {
233+ // Retried methods have the same identifier, so we have duplicates in related methods array.
234+ const uniqueHistoryRelatedMethods = this . _filterUniqueItems ( methodHistoryStatistics . relatedMethods ) ;
235+ const uniqueRelatedMethods = this . _filterUniqueItems ( method . relatedMethods ) ;
236+ return methodHistoryStatistics . identifier === method . identifier
237+ && this . _compareRelatedMethods ( uniqueHistoryRelatedMethods , uniqueRelatedMethods ) ;
238+ }
233239 ) ;
234-
235240 if ( ! methodHistory ) {
236241 methodHistory = new MethodHistoryStatistics ( method ) ;
237242 classHistory . addMethod ( methodHistory ) ;
238243 }
239-
240244 methodHistory . addRun ( method , currentHistoryIndex ) ;
241245 } ) ;
242246 } ) ;
@@ -245,6 +249,11 @@ export class HistoryStatistics {
245249 this . _classHistory = Array . from ( classHistoryMap . values ( ) ) ;
246250 }
247251
252+ private _filterUniqueItems ( arr : string [ ] ) : string [ ] {
253+ const uniqueItems = new Set ( arr ) ;
254+ return Array . from ( uniqueItems ) ;
255+ }
256+
248257 private _compareRelatedMethods ( arr1 : string [ ] , arr2 : string [ ] ) : boolean {
249258 if ( arr1 . length !== arr2 . length ) {
250259 return false ;
You can’t perform that action at this time.
0 commit comments