From 8a2482ad1b5b4f915d62c47caa2f225b475ba43a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 15 Jul 2022 17:38:01 -0400 Subject: Write test outputs to a temporary directory While occasionally useful, I almost always end up reproducing the issue live to investigate something anyway. Not keeping the many tests results around results in less clutter, and hopefully makes the test suites faster in environments with bad I/O like Docker. --- test/run_test_suite.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/test/run_test_suite.py b/test/run_test_suite.py index 3e4f9c6b..c2730dc4 100755 --- a/test/run_test_suite.py +++ b/test/run_test_suite.py @@ -209,6 +209,7 @@ def test_suite( report_filename, input_syntax, command_prefix, + out_test_dir, ): """Run all tests in a test suite manifest.""" @@ -216,11 +217,6 @@ def test_suite( test_dir = os.path.dirname(manifest_path) model, instances = _load_rdf(manifest_path, base_uri, command_prefix) - top_dir = os.path.commonpath([os.getcwd(), os.path.abspath(test_dir)]) - out_test_dir = os.path.relpath(test_dir, top_dir) - - os.makedirs(out_test_dir, exist_ok=True) - asserter = "" if os.getenv("USER") == "drobilla": asserter = "http://drobilla.net/drobilla#me" @@ -383,13 +379,15 @@ def main(): shlex.split(args.wrapper) + [args.serdi] + args.serdi_option ) - return test_suite( - args.manifest, - args.base_uri, - args.report, - args.syntax, - command_prefix, - ) + with tempfile.TemporaryDirectory() as test_out_dir: + return test_suite( + args.manifest, + args.base_uri, + args.report, + args.syntax, + command_prefix, + test_out_dir, + ) if __name__ == "__main__": -- cgit v1.2.1