Spack tests no longer clutter var/spack/stage
- Tests use a session-scoped mock stage directory so as not to interfere with the real install. - Every test is forced to clean up after itself with an additional check. We now automatically assert that no new files have been added to `spack.stage_path` during each test. - This means that tests that fail installs now need to clean up their stages, but in all other cases the check is useful.
This commit is contained in:
@@ -33,11 +33,9 @@ class Canfail(Package):
|
||||
|
||||
version('1.0', '0123456789abcdef0123456789abcdef')
|
||||
|
||||
succeed = False
|
||||
|
||||
def install(self, spec, prefix):
|
||||
try:
|
||||
succeed = getattr(self, 'succeed')
|
||||
if not succeed:
|
||||
raise InstallError("'succeed' was false")
|
||||
touch(join_path(prefix, 'an_installation_file'))
|
||||
except AttributeError:
|
||||
raise InstallError("'succeed' attribute was not set")
|
||||
if not self.succeed:
|
||||
raise InstallError("'succeed' was false")
|
||||
touch(join_path(prefix, 'an_installation_file'))
|
||||
|
Reference in New Issue
Block a user