Commit 5d250891 by Ben Patterson

TE-1014 Don't clean test_root/staticfiles when running JS tests.

parent 33327219
...@@ -33,7 +33,7 @@ class JsTestSuite(TestSuite): ...@@ -33,7 +33,7 @@ class JsTestSuite(TestSuite):
super(JsTestSuite, self).__enter__() super(JsTestSuite, self).__enter__()
self.report_dir.makedirs_p() self.report_dir.makedirs_p()
if not self.skip_clean: if not self.skip_clean:
test_utils.clean_test_files() test_utils.clean_test_files(skip_staticfiles=True)
if self.mode == 'run' and not self.run_under_coverage: if self.mode == 'run' and not self.run_under_coverage:
test_utils.clean_dir(self.report_dir) test_utils.clean_dir(self.report_dir)
......
...@@ -13,11 +13,20 @@ __test__ = False # do not collect ...@@ -13,11 +13,20 @@ __test__ = False # do not collect
@task @task
def clean_test_files(): def clean_test_files(skip_staticfiles=False):
""" """
Clean fixture files used by tests and .pyc files Clean fixture files used by tests and .pyc files
:param skip_staticfiles: To reduce interference across test suites, some suites can skip
cleaning the staticfiles directory, which is expensive to create
but not relevant for all test types.
""" """
sh("git clean -fqdx test_root/logs test_root/data test_root/staticfiles test_root/uploads") static_files_str = ""
if skip_staticfiles:
static_files_str = "test_root/staticfiles"
sh("git clean -fqdx test_root/logs test_root/data {static_files_str} test_root/uploads".format(
static_files_str=static_files_str
))
# This find command removes all the *.pyc files that aren't in the .git # This find command removes all the *.pyc files that aren't in the .git
# directory. See this blog post for more details: # directory. See this blog post for more details:
# http://nedbatchelder.com/blog/201505/be_careful_deleting_files_around_git.html # http://nedbatchelder.com/blog/201505/be_careful_deleting_files_around_git.html
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment