[Tools] testbot/web: Fix the sort order of a job's tasks.

Francois Gouget fgouget at codeweavers.com
Tue Jan 17 09:04:24 CST 2017


Each entry's id is a numeric value that's equal to step.no*100+task.no.
But by default sort performs a string comparison resulting in task
(10,1), aka "1001", coming before (1,1), aka "101", which comes before
(11,1), aka "1101", etc.

Also note that sorting is normally the job of the CollectionBlock but
the JobDetails page is bypassing it.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/web/JobDetails.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index b43d3756..cf3b4a8c 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -213,7 +213,7 @@ sub SortKeys($$$)
 {
   my ($self, $CollectionBlock, $Keys) = @_;
 
-  my @SortedKeys = sort @$Keys;
+  my @SortedKeys = sort { $a <=> $b } @$Keys;
   return \@SortedKeys;
 }
 
-- 
2.11.0



More information about the wine-patches mailing list