Ticket #12579 (closed enhancement: fixed)
Mechanism to skip self-tests (spkg-check) for certain packages
| Reported by: | jhpalmieri | Owned by: | GeorgSWeber |
|---|---|---|---|
| Priority: | minor | Milestone: | sage-5.0 |
| Component: | build | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | Jeroen Demeyer |
| Authors: | John Palmieri | Merged in: | sage-5.0.beta7 |
| Dependencies: | #4949, #12479 | Stopgaps: |
Description (last modified by jdemeyer) (diff)
With the attached patch, if you set SAGE_CHECK=yes and SAGE_CHECK_PACKAGES='!python,!cvxopt' and then build Sage, it will run self-tests for all packages except python and cvxopt. By default, SAGE_CHECK_PACKAGES=!python.
This sort of behavior can be useful with the current situation, in which python always fails self-tests (as far as I know), and a package like cvxopt fails them on OS X Lion. So when I'm testing Sage with Lion, I could use '!python,!cvxopt' and easily run self-tests on all of the other packages. This should be viewed as merely a convenience — I hope that people straighten out Python's test suite in general and cvxopt on Lion — but it might be a useful option.
Apply
- trac_12579-sage-check.v3.patch to the root repo.
- trac_12579-doc.v3.patch to the Sage library
Attachments
Change History
Changed 15 months ago by jhpalmieri
-
attachment
trac_12579-sage-check.patch
added
comment:1 Changed 15 months ago by jhpalmieri
- Status changed from new to needs_review
- Description modified (diff)
comment:2 Changed 15 months ago by jdemeyer
I'm not sure that I like the interface. Personally, I would prefer two variables: one simply to determine whether or not to run tests (SAGE_CHECK) and another to actually determine which tests to run (which by default should be set to !python).
comment:3 Changed 15 months ago by jdemeyer
- Status changed from needs_review to needs_work
As for implementation: the second variable (call it SAGE_CHECK_PACKAGES or something) should change the environment variable SAGE_CHECK accordingly, before running spkg-install. The new GCC spkg uses SAGE_CHECK in its spkg-install and it makes sense to allow that.
Example:
SAGE_CHECK_PACKAGES="!python,mpir,mpfr"
would always check mpir and mpfr, regardless of SAGE_CHECK but would never check python, regardless of SAGE_CHECK.
The default should be
SAGE_CHECK_PACKAGES="!python"
comment:4 Changed 15 months ago by jhpalmieri
My feeling was, why introduce a new environment variable when we can just use SAGE_CHECK? The whole approach might be better if we used autoconf:
./configure --self-tests=yes --skip-tests=python,cvxopt ...
or something like that. But I'll think about adding a second variable.
comment:5 Changed 15 months ago by jdemeyer
My main motivation was simply to exclude Python by default.
comment:6 Changed 15 months ago by jhpalmieri
- Status changed from needs_work to needs_review
- Description modified (diff)
Okay, here's a new version.
comment:7 Changed 15 months ago by jdemeyer
- Status changed from needs_review to needs_work
- Reviewers set to Jeroen Demeyer
Yes, this is more or less what I had in mind. Two small comments:
The lines
SAGE_CHECK=no export SAGE_CHECK
can be simplified to
export SAGE_CHECK=no
I don't know about the portability of expr, I would use grep instead. Also you don't want to match "gdmodule" when "gd" is in $SAGE_CHECK_PACKAGES. Proposal:
# Allow spaces, commas or colons as separator (the documentation suggests commas)
if echo ",$SAGE_CHECK_PACKAGES," | grep "[ ,:]\!$PKG_BASE[ ,:]" >/dev/null; then
export SAGE_CHECK=no
elif echo ",$SAGE_CHECK_PACKAGES," | grep "[ ,:]$PKG_BASE[ ,:]" >/dev/null; then
export SAGE_CHECK=yes
fi
comment:8 Changed 15 months ago by jdemeyer
The documentation should mention that SAGE_CHECK_PACKAGES='!python' by default.
comment:9 Changed 15 months ago by jdemeyer
Instead of using tr to handle lower/upper case, simply do a case-insensitive check with grep -i.
comment:10 Changed 15 months ago by jhpalmieri
- Status changed from needs_work to needs_review
Okay, new versions. (I tried expr on linux, OS X, and OpenSolaris, and it seemed to work on all of them, and it seems to be POSIX-standard, but I changed to grep anyway.)
comment:12 Changed 15 months ago by jdemeyer
- Status changed from needs_review to needs_work
- Dependencies changed from #12479 to #4949, #12479
comment:13 Changed 15 months ago by jdemeyer
- Status changed from needs_work to needs_review
- Description modified (diff)
comment:14 Changed 15 months ago by jhpalmieri
The rebasing here is fine with me; the new patch applies cleanly ater #12479.
comment:15 Changed 15 months ago by jdemeyer
- Status changed from needs_review to positive_review
Seems to work well. And Sage now builds with a simple
SAGE_CHECK=yes make
comment:17 Changed 15 months ago by jdemeyer
- Status changed from positive_review to closed
- Resolution set to fixed
- Merged in set to sage-5.0.beta7
comment:18 Changed 14 months ago by jdemeyer
- Summary changed from mechanism to skip self-tests for certain spkgs to Mechanism to skip self-tests (spkg-check) for certain packages

root repo