Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow users to test Sage script using system-wide Sage installation #6861

Closed
sagetrac-mvngu mannequin opened this issue Sep 2, 2009 · 19 comments
Closed

allow users to test Sage script using system-wide Sage installation #6861

sagetrac-mvngu mannequin opened this issue Sep 2, 2009 · 19 comments

Comments

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 2, 2009

At least in Sage 4.1.1, a regular user cannot run tests on their own Sage scripts using a system-wide installation of Sage. Doing so would result in a permission error:

[mvngu@mod mvngu]$ cat demo.sage 
print 2
[mvngu@mod mvngu]$ sage -t demo.sage 
Traceback (most recent call last):
  File "/usr/local/sage/local/bin/sage-test", line 49, in <module>
    os.makedirs(TMP)
  File "/usr/local/sage/local/lib/python/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/sage/tmp/tmp'

That is due to the testing script writing temporary data to a temporary directory under the system-wide Sage installation. A work around is to have one's own local installation of Sage under one's home directory. But it would be nice if the test script would write temporary data to the user's DOT_SAGE directory, i.e. $HOME/.sage. This problem was reported at this sage-support thread.

Component: doctest coverage

Author: Jason Grout, Francis Clarke

Reviewer: Tim Dumol

Merged: Sage 4.1.2.alpha4

Issue created by migration from https://trac.sagemath.org/ticket/6861

@sagetrac-mvngu sagetrac-mvngu mannequin added this to the sage-4.1.2 milestone Sep 2, 2009
@sagetrac-mvngu sagetrac-mvngu mannequin added t: tests labels Sep 2, 2009
@jasongrout
Copy link
Member

Attachment: trac_6861-sage-test-in-dotsage.patch.gz

@jasongrout
Copy link
Member

Author: Jason Grout

@jasongrout
Copy link
Member

comment:1

Attachment: trac_6861-sage-test-in-dotsage.2.patch.gz

The two files above are identical. One can be deleted.

@sagetrac-fwclarke
Copy link
Mannequin

sagetrac-fwclarke mannequin commented Sep 3, 2009

comment:2

Replying to @jasongrout:

In addition to the change made by the patch, some corresponding changes need making in sage-test and sage-doctest. Moreover, testing of one's own Sage scripts won't work until the changes in #6668 are also implemented (most particularly the change to line 408 of sage-doctest).

@jasongrout
Copy link
Member

comment:3

Replying to @sagetrac-fwclarke:

Replying to @jasongrout:

In addition to the change made by the patch, some corresponding changes need making in sage-test and sage-doctest. Moreover, testing of one's own Sage scripts won't work until the changes in #6668 are also implemented (most particularly the change to line 408 of sage-doctest).

You sound like you know what needs to be done. Please, please post a patch.

@sagetrac-fwclarke
Copy link
Mannequin

sagetrac-fwclarke mannequin commented Sep 3, 2009

comment:4

Replying to @jasongrout:

You sound like you know what needs to be done. Please, please post a patch.

Will do, but not immediately; there are a few things I don't quite understand, and I'm off to the day-job now.

@sagetrac-fwclarke
Copy link
Mannequin

sagetrac-fwclarke mannequin commented Sep 5, 2009

comment:5

Replying to @sagetrac-fwclarke:

There are a few things I don't quite understand ...

It seems to me that if (because of the changed definition of SAGE_TESTDIR) the directory ~/.sage/tmp is to be used for testing system files, then logically it should also be used for testing users' own files. This requires a few more changes.

It also seems worthwhile to active the function delete_tmpfiles in sage-doctest; at present this function does nothing. The obvious things is for it to get called if the doctest succeeds without any failures, but at present the method of counting the number of failures is defective.

I have implemented these ideas and am testing the code. A patch will follow soon.

@sagetrac-fwclarke
Copy link
Mannequin

sagetrac-fwclarke mannequin commented Sep 5, 2009

comment:6

The new patch, which incorporates the change in the earlier patch, also includes the changes made in the patch at #6668.

@sagetrac-fwclarke
Copy link
Mannequin

sagetrac-fwclarke mannequin commented Sep 5, 2009

replaces earlier patches

@sagetrac-fwclarke
Copy link
Mannequin

sagetrac-fwclarke mannequin commented Sep 10, 2009

comment:7

Attachment: trac_6861_new.patch.gz

I have added an extra patch (to be applied after trac_6861_new.patch) which deals with a problem in testing files specified by their full path name, as discussed in sage-devel.

@sagetrac-fwclarke
Copy link
Mannequin

sagetrac-fwclarke mannequin commented Sep 10, 2009

Attachment: trac_6861_extra.patch.gz

apply after trac_6861_new.patch

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Sep 23, 2009

comment:8

Patches work perfectly, and I've run several dozen doctests without any problems. Temporary files are deleted as promised. Nice job guys. Positive review.

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Sep 23, 2009

Reviewer: Tim Dumol

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Sep 23, 2009

Changed author from Jason Grout to Jason Grout, Francis Clarke

@sagetrac-mvngu
Copy link
Mannequin Author

sagetrac-mvngu mannequin commented Sep 24, 2009

comment:9

Merged in the script repository.

@sagetrac-mvngu
Copy link
Mannequin Author

sagetrac-mvngu mannequin commented Sep 24, 2009

Merged: Sage 4.1.2.alpha3

@sagetrac-mvngu sagetrac-mvngu mannequin closed this as completed Sep 24, 2009
@sagetrac-mvngu sagetrac-mvngu mannequin reopened this Sep 24, 2009
@sagetrac-mvngu
Copy link
Mannequin Author

sagetrac-mvngu mannequin commented Sep 27, 2009

comment:11

There is no 4.1.2.alpha3. Sage 4.1.2.alpha3 was William Stein's release for working on making the notebook a standalone package.

@sagetrac-mvngu
Copy link
Mannequin Author

sagetrac-mvngu mannequin commented Sep 27, 2009

Changed merged from Sage 4.1.2.alpha3 to Sage 4.1.2.alpha4

@sagetrac-mvngu
Copy link
Mannequin Author

sagetrac-mvngu mannequin commented Sep 30, 2009

comment:12

See #7079 for a case where the current ticket breaks parallel doctesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant