(1) relocate cache for tests (2) initial approach for restoring unit tests (just for git tests although the same concept applies to the other unit tests which are failing - namely those for svn and hg)

This commit is contained in:
Peter Scheibel 2016-03-22 19:37:47 -07:00
parent 75460d8586
commit cb9fba98d8
2 changed files with 8 additions and 0 deletions

View file

@ -23,6 +23,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import os
import shutil
from pprint import pprint
from llnl.util.filesystem import join_path, mkdirp
@ -66,4 +67,7 @@ def test(parser, args):
if not os.path.exists(outputDir):
mkdirp(outputDir)
spack.cache_path = join_path(spack.var_path, "test-cache")
mkdirp(spack.cache_path)
spack.test.run(args.names, outputDir, args.verbose)
shutil.rmtree(spack.cache_path)

View file

@ -30,6 +30,8 @@
from spack.test.mock_repo import MockGitRepo
from spack.version import ver
import shutil
import os
class GitFetchTest(MockPackagesTest):
"""Tests fetching from a dummy git repository."""
@ -49,6 +51,8 @@ def tearDown(self):
"""Destroy the stage space used by this test."""
super(GitFetchTest, self).tearDown()
self.repo.destroy()
for d in os.listdir(spack.cache_path):
shutil.rmtree(os.path.join(spack.cache_path, d))
def assert_rev(self, rev):
"""Check that the current git revision is equal to the supplied rev."""