Skip to content

Commit

Permalink
Fix #244 all info are grouped into 1st itertaion when no Unroll
Browse files Browse the repository at this point in the history
Change-Id: I32b112b674135f0466c76214339d3c73b10a22a0
  • Loading branch information
Frankie0701 committed Mar 17, 2023
1 parent 51eaf57 commit 4bb11c1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class InfoContainer {
private static String keyFor( String specName,
FeatureInfo feature,
IterationInfo iteration ) {
def index = Utils.isUnrolled( feature ) ? iteration.iterationIndex : -1
def index = Utils.isUnrolled( feature ) || ( iteration != null && iteration.estimatedNumIterations < 0 ) ? iteration.iterationIndex : -1
"$specName${feature?.name}$index"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,19 @@ class HtmlReportCreator extends AbstractHtmlCreator<SpecData>
failures ? 'failure' :
( !run || Utils.isSkipped( feature ) ) ? 'ignored' : ''

// collapse the information for all iterations
def extraInfo = run ? ( 1..run.failuresByIteration.size() ).collectMany {
Utils.nextSpecExtraInfo( data, feature )
} : [ ]
def iterations = run ? run.copyFailuresByIteration().keySet().toList().sort { it.iterationIndex } : []
// Link each iteration's extra info to itself when there is no @Unroll
def extraInfo = []
def multipleIterations = iterations.size() > 1
if (run && multipleIterations) {
extraInfo = iterations.collectMany {
Utils.nextSpecExtraInfo(data, feature, it).collect { info -> "Iteration ${it.iterationIndex} extra info: $info" }
}
} else if (run) {
extraInfo = ( 1..run.failuresByIteration.size() ).collectMany {
Utils.nextSpecExtraInfo( data, feature )
}
}

Long time = run == null ? null : run.timeByIteration.values().sum()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ <h3>Features:</h3>
<div class='extra-info'>
<ul>
<li>
<div>The current iteration is 0 (not-unrolled)</div>
<div>Iteration 0 extra info: The current iteration is 0 (not-unrolled)</div>
</li>
<li>
<div>The current iteration is 1 (not-unrolled)</div>
<div>Iteration 1 extra info: The current iteration is 1 (not-unrolled)</div>
</li>
<li>
<div>The current iteration is 2 (not-unrolled)</div>
<div>Iteration 2 extra info: The current iteration is 2 (not-unrolled)</div>
</li>
</ul>
</div>
Expand Down

0 comments on commit 4bb11c1

Please sign in to comment.