Do not report on packages installed from the cache (#12336)

Skip generating reports for any packages that were found in the binary cache.
This commit is contained in:
Zack Galbreath 2019-08-16 13:19:11 -04:00 committed by Todd Gamblin
parent 7bb08b6ecb
commit cef1e4e0b4
3 changed files with 15 additions and 1 deletions

View File

@ -493,6 +493,10 @@ def __init__(self, spec):
# Allow custom staging paths for packages
self.path = None
# Keep track of whether or not this package was installed from
# a binary cache.
self.installed_from_binary_cache = False
# Check versions in the versions dict.
for v in self.versions:
assert (isinstance(v, Version))
@ -1420,6 +1424,7 @@ def try_install_from_binary_cache(self, explicit):
binary_distribution.extract_tarball(
binary_spec, tarball, allow_root=False,
unsigned=False, force=False)
self.installed_from_binary_cache = True
spack.store.db.add(
self.spec, spack.store.layout, explicit=explicit)
return True

View File

@ -126,7 +126,8 @@ def wrapper(pkg, *args, **kwargs):
'id': pkg.spec.dag_hash(),
'elapsed_time': None,
'result': None,
'message': None
'message': None,
'installed_from_binary_cache': False
}
start_time = time.time()
@ -136,6 +137,8 @@ def wrapper(pkg, *args, **kwargs):
value = do_install(pkg, *args, **kwargs)
package['result'] = 'success'
package['stdout'] = fetch_package_log(pkg)
package['installed_from_binary_cache'] = \
pkg.installed_from_binary_cache
if installed_on_entry:
return

View File

@ -221,6 +221,12 @@ def build_report(self, directory_name, input_data):
# do not explicitly include the package's name in the CDash build name.
num_packages = 0
for spec in input_data['specs']:
# Do not generate reports for packages that were installed
# from the binary cache.
spec['packages'] = [
x for x in spec['packages']
if not x['installed_from_binary_cache']
]
for package in spec['packages']:
if 'stdout' in package:
num_packages += 1