]> code.ossystems Code Review - openembedded-core.git/commitdiff
resulttool/manualexecution: Fixed step sorted by integer
authorYeoh Ee Peng <ee.peng.yeoh@intel.com>
Thu, 4 Apr 2019 08:48:37 +0000 (16:48 +0800)
committerArmin Kuster <akuster808@gmail.com>
Sat, 6 Apr 2019 11:17:07 +0000 (16:47 +0530)
Currently the manual execution display step by sorting
the step as string, where steps were not being sorted
correctly when there are more than 9 steps.

Fixed the step sorting by sorting step as integer.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
scripts/lib/resulttool/manualexecution.py

index 07835407d572953eebdcc0bbaced5e8ca7f69b56..9a29b0b273c6f0897abb1e905beaa57252a47ea9 100755 (executable)
@@ -85,7 +85,7 @@ class ManualTestRunner(object):
         print('------------------------------------------------------------------------')
         print('You have total ' + str(total_steps) + ' test steps to be executed.')
         print('------------------------------------------------------------------------\n')
-        for step in sorted((self.jdata[test_id]['test']['execution']).keys()):
+        for step, _ in sorted(self.jdata[test_id]['test']['execution'].items(), key=lambda x: int(x[0])):
             print('Step %s: ' % step + self.jdata[test_id]['test']['execution']['%s' % step]['action'])
             expected_output = self.jdata[test_id]['test']['execution']['%s' % step]['expected_results']
             if expected_output: