Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#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: Merged in: sage-5.0.beta7
Authors: John Palmieri Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #4949, #12479 Stopgaps:

Status badges

Description (last modified by jdemeyer)

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

Attachments (6)

trac_12579-sage-check.patch (758 bytes) - added by jhpalmieri 9 years ago.
root repo
trac_12579-doc.patch (1.2 KB) - added by jhpalmieri 9 years ago.
Sage library
trac_12579-sage-check.v2.patch (1.8 KB) - added by jhpalmieri 9 years ago.
root repo
trac_12579-doc.v2.patch (2.0 KB) - added by jhpalmieri 9 years ago.
Sage library
trac_12579-doc.v3.patch (2.0 KB) - added by jdemeyer 9 years ago.
Rebased to #4949
trac_12579-sage-check.v3.patch (1.7 KB) - added by jdemeyer 9 years ago.
Rebased to #12479

Download all attachments as: .zip

Change History (24)

Changed 9 years ago by jhpalmieri

root repo

Changed 9 years ago by jhpalmieri

Sage library

comment:1 Changed 9 years ago by jhpalmieri

  • Description modified (diff)
  • Status changed from new to needs_review

comment:2 Changed 9 years 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 9 years 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 9 years 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 9 years ago by jdemeyer

My main motivation was simply to exclude Python by default.

comment:6 Changed 9 years ago by jhpalmieri

  • Description modified (diff)
  • Status changed from needs_work to needs_review

Okay, here's a new version.

comment:7 Changed 9 years ago by jdemeyer

  • Reviewers set to Jeroen Demeyer
  • Status changed from needs_review to needs_work

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 9 years ago by jdemeyer

The documentation should mention that SAGE_CHECK_PACKAGES='!python' by default.

comment:9 Changed 9 years ago by jdemeyer

Instead of using tr to handle lower/upper case, simply do a case-insensitive check with grep -i.

comment:10 Changed 9 years 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.)

Changed 9 years ago by jhpalmieri

root repo

Changed 9 years ago by jhpalmieri

Sage library

comment:11 Changed 9 years ago by jdemeyer

  • Dependencies set to #12479
  • Description modified (diff)

comment:12 Changed 9 years ago by jdemeyer

  • Dependencies changed from #12479 to #4949, #12479
  • Status changed from needs_review to needs_work

Changed 9 years ago by jdemeyer

Rebased to #4949

comment:13 Changed 9 years ago by jdemeyer

  • Description modified (diff)
  • Status changed from needs_work to needs_review

comment:14 Changed 9 years ago by jhpalmieri

The rebasing here is fine with me; the new patch applies cleanly ater #12479.

Changed 9 years ago by jdemeyer

Rebased to #12479

comment:15 Changed 9 years 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:16 Changed 9 years ago by jdemeyer

  • Description modified (diff)

comment:17 Changed 9 years ago by jdemeyer

  • Merged in set to sage-5.0.beta7
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:18 Changed 9 years 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
Note: See TracTickets for help on using tickets.