spack: spack install --test root not working properly in environment

Steps to reproduce

When installing py-numpy in a environment with other root packages and the --test root flag is set, it fails to build because it cannot find py-pytest and it doesn’t show up as a dependency in the concretization.

spack add lbann@gitlab-pip-ivybridge +lld +deterministic +vision +numpy +onednn +half +fft ^hydrogen@develop ^dihydrogen@develop ^aluminum@master %clang ^mvapich2 ^hwloc@1.11.13 ^libtool@2.4.2 ^python@3.9.10
spack develop --no-clone -p /usr/WS2/lbannusr/brian-lbann.git lbann@gitlab-pip-ivybridge
spack add py-numpy@1.16.0:
spack concretize --reuse --test root
spack install --reuse -j26 --test root

Error message

==> [2022-03-09-13:26:12.477072] '/usr/WS2/lbannusr/spack_installed_packages/catalyst/opt/spack/linux-rhel7-ivybridge/clang-12.0.1/python-3.9.10-qassf33p2hkuptbbkb2yzlq4odqmngej/bin/python3.9' '-c' 'import numpy; numpy.test("full", verbose=2)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/WS2/lbannusr/spack_installed_packages/catalyst/opt/spack/linux-rhel7-ivybridge/clang-12.0.1/py-numpy-1.22.2-wasb6dleomiv433qdtmlkn3msjhzzeqp/lib/python3.9/site-packages/numpy/_pytesttester.py", line 128, in __call__
    import pytest
ModuleNotFoundError: No module named 'pytest'

spack_lock.txt spack_yaml.txt spack-build-env.txt spack-build-lbann-gitlab-pip-ivybridge.log spack-build-out.txt

Information on your system

This happened on pascal, catalyst, and lassen at LLNL LC.

* **Spack:** 0.17.1-1431-1c23f5abe0
* **Python:** 3.7.2
* **Platform:** linux-rhel7-ivybridge
* **Concretizer:** clingo

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 2
  • Comments: 21 (20 by maintainers)

Commits related to this issue

Most upvoted comments

This seems to happen even outside of environments, staying with the podio example:

spack install --test=root podio seems to work and install podio, but the tests are not run

On the other hand

spack dev-build --test=root podio@master runs into the problem that catch2 is not in the build environment and podio fails at the cmake stage.