diff options
author | Peter Scheibel <scheibel1@llnl.gov> | 2015-10-26 15:26:08 -0700 |
---|---|---|
committer | Peter Scheibel <scheibel1@llnl.gov> | 2015-10-26 15:26:08 -0700 |
commit | 3b554c709bb1dc3704939964ac1265ccf8597718 (patch) | |
tree | 31a3fbf735c765f292294816defedcd13e04232b /lib | |
parent | 9576860f8c97360eddaffe316450ed2f3b87e876 (diff) | |
download | spack-3b554c709bb1dc3704939964ac1265ccf8597718.tar.gz spack-3b554c709bb1dc3704939964ac1265ccf8597718.tar.bz2 spack-3b554c709bb1dc3704939964ac1265ccf8597718.tar.xz spack-3b554c709bb1dc3704939964ac1265ccf8597718.zip |
Fetch errors were also terminating runs of test-install with system exit, so
stage.fetch() was updated to raise a FetchError instead of calling tty.die().
Output is the same for spack install in case of a fetch error.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/test-install.py | 6 | ||||
-rw-r--r-- | lib/spack/spack/stage.py | 3 | ||||
-rw-r--r-- | lib/spack/spack/test/unit_install.py | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/spack/spack/cmd/test-install.py b/lib/spack/spack/cmd/test-install.py index 76602474a4..58ab40aa7b 100644 --- a/lib/spack/spack/cmd/test-install.py +++ b/lib/spack/spack/cmd/test-install.py @@ -34,6 +34,7 @@ from llnl.util.filesystem import * import spack from spack.build_environment import InstallError +from spack.fetch_strategy import FetchError import spack.cmd description = "Treat package installations as unit tests and output formatted test results" @@ -132,6 +133,9 @@ def create_test_output(topSpec, newInstalls, output, getLogFunc=fetch_log): depBID = BuildId(dep) errOutput = "Skipped due to failed dependency: {0}".format( depBID.stringId()) + elif (not package.installed) and (not package.stage.archive_file): + result = TestResult.FAILED + errOutput = "Failure to fetch package resources." elif not package.installed: result = TestResult.FAILED lines = getLogFunc(package.build_log_path) @@ -196,6 +200,8 @@ def test_install(parser, args): fake=False) except InstallError: pass + except FetchError: + pass jrf = JunitResultFormat() handled = {} diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index 008c5f0429..78930ecb5b 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -261,7 +261,8 @@ class Stage(object): tty.debug(e) continue else: - tty.die("All fetchers failed for %s" % self.name) + errMessage = "All fetchers failed for %s" % self.name + raise fs.FetchError(errMessage, None) def check(self): diff --git a/lib/spack/spack/test/unit_install.py b/lib/spack/spack/test/unit_install.py index 2a94f8fec0..c4b9092f05 100644 --- a/lib/spack/spack/test/unit_install.py +++ b/lib/spack/spack/test/unit_install.py @@ -105,6 +105,8 @@ class UnitInstallTest(unittest.TestCase): self.assertEqual(mo.results, {bIdX:test_install.TestResult.PASSED}) + #TODO: add test(s) where Y fails to install + class MockPackageDb(object): def __init__(self, init=None): self.specToPkg = {} |