--run-tests install argument and petsc fixes#1169
Conversation
ab9bc70 to
f43db34
Compare
|
if self.run_tests:
make('check')No sense in having to negate it every time. |
|
@adamjstewart agree, will do. |
|
It looks fine to me. |
|
@davydden @adamjstewart @nrichart: I like this in theory but i think the right way to do it is to put another method on That would also open up the possibility of independently running tests outside the install process. I think it would actually be nice if How opposed would you all be to implementing that? I thin it's not actually that much more work than this PR. |
|
@tgamblin I agree. I also think we need to have the idea of a pre-install test and a post-install test. Many packages comes with a def configure(self, spec, prefix):
configure('--prefix={0}'.format(prefix))
def build(self, spec, prefix):
make()
def build_test(self, spec, prefix):
make('check')
def install(self, spec, prefix):
make('install')
def install_test(self, spec, prefix):
make('installcheck')For more complicated packages, install_test can be hand-written and include some of the tests in hdf5 for example. Of course, not all build systems will have every one of these steps, and we don't want to have to change all of the packages currently in Spack, so if we see these functions, we run them, and if we don't, we skip them. Anyway, by default, Spack should run all of these during installation. If |
|
@adamjstewart: I like it. Note that @citibeth has actually already done much of this in her A few things:
|
👍 |
|
Hmm, I see your point. I agree that we shouldn't be running MPI jobs across multiple nodes by default. But some tests (make test, make installcheck, sanity checks, and the check_install in hdf5) would be fine to run. Is there some way we could distinguish those? @citibeth's StagedPackage would work fine. I think we should make StagedPackage -> Package. Like you said, for backwards compatibility, if packages only have an |
|
I am fine with making tests @adamjstewart one could have |
Not generally. What about the cross-compiled case (blue gene?). Those commands won't actually work either. Typically on Cray you can get away with running backend-compiled stuff on the frontend, but not always. That said, the new architecture support actually does distinguish backend (compute) and frontend (login) architectures on a platform. So you can tell if you're building for one or the other. You could skip the tests or force an
👍 |
@davydden: how about we update this PR to add a |
will do. |
|
w.r.t. separating into Seprating a Also the order of build, isntall and build_test might be different. For example here it is: build, install and build_test. So i would say it is more flexible to keep a single function to do everything. I would stick with the current |
|
@davydden: I'm also torn about this and kind of like the simplicity of I'm not sure why we need I see a few pros and cons: * Pro*
Con
Con (1) is mitigated somewhat by @adamjstewart and @citibeth's proposals of more specialized package classes (I believe Homebrew does things like this) that could contain support for things like autotools and cmake, and would mean you probably don't have to implement anything but I don't think the changes we're proposing here require people to implement What do you think? |
some tests like
I thinks that's what |
|
As @davydden said, |
I'll try to push this a little further... what about implementing in
This will allow a packager to be as flexible as we are now (or even more) and will permit more concise logic if the package is well behaved. As the phases will be named we may then have a command like : to stop after phase |
|
@alalazo If you have an arbitrary number of phases, how do you tell Python which of them to run and in what order? |
|
@adamjstewart simple metaprogramming in |
|
@adamjstewart the simplest example I could conceive on the language mechanism |
8d9a15f to
c096bb3
Compare
|
@tgamblin i switched to |
Moving to sub-phases in #543 was done out of necessity: I needed a way to run what's now For PR #543 I would admit that
With what we have right now, this could be done in a permanent way for any package: subclass On how Spack decides whether or not to use the sub-phases... Spack just calls the top-level
This would in one sense not break anything. But what happens when you run Yes, PR #543 is CMake-only. Autotools and maybe Python Setuptools are obvious extensions. But since I don't create projects with Autotools, I'm not in a position to do the work. I'm happy to help out any Autotools developers who want to see it happen. Other comments on this PR:
|
I agree with @alalazo here that
would do, but this looks like an overkill to me as a simple flag to
That's not yet implemented, whereas we need something to fix current issues with packages which run tests and fail in HPC environment. |
|
For who's interested, I started to sketch the design idea I was talking about yesterday in #1186 |
|
I thought a little more about this and I've come to agree with making "no tests" the default. A large portion of the packages I install, even simple GNU libraries, fail Another consideration I thought of: It would be nice to run post-install tests without the Spack compiler wrappers. This would help us discover cases where we need to filter out the compilers. @alalazo I took a look at #1186. I know arbitrary install phases are doable, but can you give me good use cases? Another one I thought of would be filter_compilers, which is pretty common. @citibeth I'm not opposed to the idea of subclassing Package for each build system. I know you already have one for CMake, and you mentioned doing the same for Python to solve the RPATH issue. I'm still not sure whether we should make all of the stages I mentioned defaults in Package or integrate them into your StagedPackage. I can see merits for both. |
how about |
|
On Thu, Jul 7, 2016 at 5:17 PM, Adam J. Stewart [email protected]
What if tests get run when available, with the results stored in a DB, plus
|
|
@citibeth Another reason I'm hesitant to run tests by default is that they can take very long (I'm currently installing something that took 30 seconds to build and has been testing for over an hour now). |
|
There are two issues here:
I'm suggesting we set up a framework so that package installation does NOT On Thu, Jul 7, 2016 at 5:33 PM, Adam J. Stewart [email protected]
|
|
I think tests should not be run by default, but if users decide to enable them then installation should depend on tests passing. |
|
The problem is that for some packages, the tests just don't work. Users On Thu, Jul 7, 2016 at 10:34 PM, Adam J. Stewart [email protected]
|
|
Exactly, which is why tests should be off by default 😃 |
|
+1 for build tests passing be prerequisite for installation if the user asked them to run. |
|
@tgamblin if there are no further comments on the |
|
Ok I merged this. It would be nice to converge on how best to get a separate test method soon, e.g. though #1186 (though I haven't had a chance to look at that one).
Given that some packages build really fast but the tests take forever, I think we ought to keep them off by default. I would like stuff like this (public package build results) to be done by CI / nightly testing. |
@davydden What I meant by this, if I wasn't clear, is that we shouldn't add |
|
@adamjstewart nobody plans to remove |
|
Once #1186 is merged, the correct way to support testing will be to subclass AutotoolsPackage and implement |
|
@adamjstewart In #1186, at the moment, tests are just another @CMakePackage.sanity_check('build')
@CMakePackage.on_package_attributes(run_tests=True)
def check(self):
make('test')just means that the function I tried to maintain complete backward compatibility so far 😄 EDIT : just to be completely clear, the function |
|
@alalazo Hmm, is there any way we can get by with: def check(self):
make('test')Instead of: @CMakePackage.sanity_check('build')
@CMakePackage.on_package_attributes(run_tests=True)
def check(self):
make('test')The point of the package.py is to abstract out as much of the complicated stuff as we can so you don't even need to know Python to add a new package. Personally, I don't even know how Python decorators work. |
agree
don't agree. #1186 is backward compatible, so all packages eventually are going to be refactored into stages if/when it is merged. From that perspective using
moving packages to stages aint gonna happen in 1 day, the fact that |
IMHO in most cases this is simply copy-pasting, so if the author of a new package see another one with he will just copy paste it into its own and define appropriate checks within this function. So i personally like the current design of #1186. p.s. As a matter of fact before i started contribute to Spack i new nothing about python. |
|
Copy-pasting is fine, but not as fun as not-copy-pasting. If |
|
Does this warrant a new |
Yes! For example, GCC requires DejaGnu, Tcl, and Expect to run its testsuite: |
|
In terms of linking, it should be pretty similar to the build deptype. The only difference is that it isn't required unless someone installs with |
👍, as an example some packages might require for testing |
Implements
--no-testsargument as discussed here #169 and fixes the issue reported #1145 (comment) by allowing to skip small tests.tested on macOS.
@adamjstewart @alalazo @mathstuf: ping.