Skip to content

Commit 08e51c1

Browse files
committed
[tests] Remove cache directory by default when running test_runner
1 parent c85b080 commit 08e51c1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/functional/test_runner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ def main():
163163
parser.add_argument('--force', '-f', action='store_true', help='run tests even on platforms where they are disabled by default (e.g. windows).')
164164
parser.add_argument('--help', '-h', '-?', action='store_true', help='print help text and exit')
165165
parser.add_argument('--jobs', '-j', type=int, default=4, help='how many test scripts to run in parallel. Default=4.')
166+
parser.add_argument('--keepcache', '-k', action='store_true', help='the default behavior is to flush the cache directory on startup. --keepcache retains the cache from the previous testrun.')
166167
parser.add_argument('--quiet', '-q', action='store_true', help='only print results summary and failure logs')
167168
parser.add_argument('--nozmq', action='store_true', help='do not run the zmq tests')
168169
args, unknown_args = parser.parse_known_args()
@@ -241,6 +242,9 @@ def main():
241242

242243
check_script_list(config["environment"]["SRCDIR"])
243244

245+
if not args.keepcache:
246+
shutil.rmtree("%s/test/cache" % config["environment"]["BUILDDIR"], ignore_errors=True)
247+
244248
run_tests(test_list, config["environment"]["SRCDIR"], config["environment"]["BUILDDIR"], config["environment"]["EXEEXT"], args.jobs, args.coverage, passon_args)
245249

246250
def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=False, args=[]):

0 commit comments

Comments
 (0)