testnode: run first found runTestSuite from lowest matching partition, not random one.

glob uses os.listdir, which returns list in arbitrary order.
Sometimes we have seevral partitions containing bin/runTestSuite. We want to use the one closest to the root instance (i.e alphabetical order, test0-1/bin/runTestSuite is better thantest0-3/bin/runTestSuite).

Usecase: webrunner, for which main instance contains a bin/runTestSuite for unit tests. But resiliency tests (dedicated partition, usually test0-0) also has bin/runTestSuite, and then requests a normal instance of slaprunner (usually test0-3).
parent abae3539
......@@ -124,8 +124,8 @@ class UnitTestRunner():
config = self.testnode.config
parameter_list = []
slapos_controler = self._getSlapOSControler(self.testnode.working_directory)
run_test_suite_path_list = glob.glob("%s/*/bin/runTestSuite" % \
slapos_controler.instance_root)
run_test_suite_path_list = sorted(glob.glob("%s/*/bin/runTestSuite" % \
slapos_controler.instance_root))
if not len(run_test_suite_path_list):
raise ValueError('No runTestSuite provided in installed partitions.')
run_test_suite_path = run_test_suite_path_list[0]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment