Browse Source

Improve error handling for database:none (as opposed to database:None) (#3387)

* Improve error handling for database:none (as opposed to database:None)

Before, the test would fail without printing anything in the console.
Now, the toolset will:
- handle any capitalization of "none" in database:none
- print the exception stack trace to the console if some other error
  were to happen in the same place

* Remove mention of "setup.py", which is not a thing anymore
Michael Hixson 7 years ago
parent
commit
b6841c71c3
1 changed files with 4 additions and 3 deletions
  1. 4 3
      toolset/benchmark/benchmarker.py

+ 4 - 3
toolset/benchmark/benchmarker.py

@@ -400,7 +400,7 @@ class Benchmarker:
                     return sys.exit(1)
                     return sys.exit(1)
 
 
                 # Start database container
                 # Start database container
-                if test.database != "None":
+                if test.database.lower() != "none":
                     database_container_id = docker_helper.start_database(
                     database_container_id = docker_helper.start_database(
                         self.config, test.database.lower())
                         self.config, test.database.lower())
                     if not database_container_id:
                     if not database_container_id:
@@ -481,9 +481,10 @@ class Benchmarker:
             except KeyboardInterrupt:
             except KeyboardInterrupt:
                 docker_helper.stop(self.config, database_container_id, test,
                 docker_helper.stop(self.config, database_container_id, test,
                                    out)
                                    out)
-            except (OSError, IOError, subprocess.CalledProcessError):
+            except (OSError, IOError, subprocess.CalledProcessError) as e:
+                traceback.print_exc()
                 self.results.write_intermediate(
                 self.results.write_intermediate(
-                    test.name, "<setup.py> raised an exception")
+                    test.name, "error during test setup: " + str(e))
                 out.write(header("Subprocess Error %s" % test.name))
                 out.write(header("Subprocess Error %s" % test.name))
                 traceback.print_exc(file=out)
                 traceback.print_exc(file=out)
                 out.flush()
                 out.flush()