diff options
| author | Jay Pipes <jpipes@serialcoder> | 2010-07-16 10:03:22 -0500 |
|---|---|---|
| committer | Jay Pipes <jpipes@serialcoder> | 2010-07-16 10:03:22 -0500 |
| commit | c3505507a5b4c0d88164e8e6dfea405c902004ff (patch) | |
| tree | 84461ffed2e8c09e280167de4b7137fb920d5b46 | |
| parent | 67d4e16a8c18989e73456f79220b97faa7374d92 (diff) | |
| download | nova-c3505507a5b4c0d88164e8e6dfea405c902004ff.tar.gz nova-c3505507a5b4c0d88164e8e6dfea405c902004ff.tar.xz nova-c3505507a5b4c0d88164e8e6dfea405c902004ff.zip | |
Adds a flag to redirect STDERR when running run_tests.py. Defaults to a truncate-on-write logfile named run_tests.err.log. Adds ignore rule for generated errlog file.
| -rw-r--r-- | .bzrignore | 1 | ||||
| -rw-r--r-- | run_tests.py | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/.bzrignore b/.bzrignore new file mode 100644 index 000000000..93fc868a3 --- /dev/null +++ b/.bzrignore @@ -0,0 +1 @@ +run_tests.err.log diff --git a/run_tests.py b/run_tests.py index bd1587d43..53d4d7ebe 100644 --- a/run_tests.py +++ b/run_tests.py @@ -39,6 +39,7 @@ Due to our use of multiprocessing it we frequently get some ignorable """ import __main__ +import os import sys from nova import vendor @@ -66,6 +67,9 @@ FLAGS = flags.FLAGS flags.DEFINE_bool('flush_db', True, 'Flush the database before running fake tests') +flags.DEFINE_string('tests_stderr', 'run_tests.err.log', + 'Path to where to pipe STDERR during test runs. Default = "run_tests.err.log"') + if __name__ == '__main__': OptionsClass = twistd.WrapTwistedOptions(trial_script.Options) config = OptionsClass() @@ -85,6 +89,11 @@ if __name__ == '__main__': else: from nova.tests.real_flags import * + # Establish redirect for STDERR + sys.stderr.flush() + err = open(FLAGS.tests_stderr, 'w+', 0) + os.dup2(err.fileno(), sys.stderr.fileno()) + if len(argv) == 1 and len(config['tests']) == 0: # If no tests were specified run the ones imported in this file # NOTE(termie): "tests" is not a flag, just some Trial related stuff |
