Browse Source

Prefer automatic verification on tests with a database

At some point we will run all test we can on travis, but for now we
need to choose one test per framework directory for verification.
This teaches run-ci to prefer tests that use a database for
verification - these are much more likely to be where problems
are found than tests that don't use a database
Hamilton Turner 11 years ago
parent
commit
b66e783261
1 changed files with 8 additions and 2 deletions
  1. 8 2
      toolset/run-ci.py

+ 8 - 2
toolset/run-ci.py

@@ -39,7 +39,7 @@ class CIRunnner:
       tests = self.gather_tests()
       tests = self.gather_tests()
       
       
       # Run the first linux-only test in this directory
       # Run the first linux-only test in this directory
-      # At the moment, travis only supports mysql!
+      # At the moment, travis only supports mysql or none!
       dirtests = [t for t in tests if t.directory == test_directory]
       dirtests = [t for t in tests if t.directory == test_directory]
       osvalidtests = [t for t in dirtests if t.os.lower() == "linux"
       osvalidtests = [t for t in dirtests if t.os.lower() == "linux"
                     and (t.database_os.lower() == "linux" or t.database_os.lower() == "none")]
                     and (t.database_os.lower() == "linux" or t.database_os.lower() == "none")]
@@ -52,7 +52,13 @@ class CIRunnner:
         if len(osvalidtests) != 0:
         if len(osvalidtests) != 0:
           log.critical("Note: Found tests that could run in Travis-CI if more databases were supported")
           log.critical("Note: Found tests that could run in Travis-CI if more databases were supported")
         sys.exit(1)
         sys.exit(1)
-      self.test = validtests[0]
+      
+      # Prefer mysql tests over 'none' if we have both
+      preferred = [t for t in validtests if t.database.lower() == "mysql"]
+      if len(preferred) > 0:
+        self.test = preferred[0]
+      else:
+        self.test = validtests[0]
       self.name = self.test.name
       self.name = self.test.name
       log.info("Choosing to run test %s in %s", self.name, test_directory)
       log.info("Choosing to run test %s in %s", self.name, test_directory)