Skip to content

Commit

Permalink
when all the same version and java, sort runs by start time
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Dec 14, 2024
1 parent 1f1ebec commit 2be5b68
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions custom/spreadsheet-cfml/test/report.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"java": json.javaVersion,
"version": json.CFMLEngineVersion,
"totalDuration": json.totalDuration,
"startTime": json.startTime,
"stats": queryToStruct(q, "suiteSpec")
});
};
Expand Down Expand Up @@ -98,13 +99,29 @@
var sortedRuns = duplicate(runs);
arraySort(
sortedRuns,
function (e1, e2){
return compare(e1.version & e1.java, e2.version & e2.java);
}
); // sort runs by oldest version to newest version
// check if the version and java is all the same, then sort by starttime
var runKeys = {};
loop array=sortedRuns index="r" item="i" {
runKeys[ i.version & i.java ] = true;
}
if ( structCount( runKeys ) eq 1 ){
// all the same version and java, sort runs by start time
arraySort(
sortedRuns,
function (e1, e2){
return compare( e1.startTime, e2.startTime );
}
);
} else {
// sort runs by oldest version to newest version
arraySort(
sortedRuns,
function (e1, e2){
return compare( e1.version & e1.java, e2.version & e2.java );
}
);
}
var hdr = [ "Suite / Spec" ];
var div = [ "---" ];
Expand Down

0 comments on commit 2be5b68

Please sign in to comment.