#6861 closed enhancement (fixed)
[with patch, positive review] allow users to test Sage script using system-wide Sage installation
Reported by: | mvngu | Owned by: | tbd |
---|---|---|---|
Priority: | major | Milestone: | sage-4.1.2 |
Component: | doctest coverage | Keywords: | |
Cc: | Merged in: | Sage 4.1.2.alpha4 | |
Authors: | Jason Grout, Francis Clarke | Reviewers: | Tim Dumol |
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
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.
Attachments (4)
Change History (16)
Changed 12 years ago by
Changed 12 years ago by
comment:1 follow-up: ↓ 2 Changed 12 years ago by
- Summary changed from allow users to test Sage script using system-wide Sage installation to [with patch , needs review] allow users to test Sage script using system-wide Sage installation
comment:2 in reply to: ↑ 1 ; follow-up: ↓ 3 Changed 12 years ago by
comment:3 in reply to: ↑ 2 ; follow-up: ↓ 4 Changed 12 years ago by
Replying to fwclarke:
Replying to jason:
In addition to the change made by the patch, some corresponding changes need making in
sage-test
andsage-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 ofsage-doctest
).
You sound like you know what needs to be done. Please, please post a patch.
comment:4 in reply to: ↑ 3 ; follow-up: ↓ 5 Changed 12 years ago by
Replying to jason:
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.
comment:5 in reply to: ↑ 4 Changed 12 years ago by
Replying to 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.
comment:6 Changed 12 years ago by
The new patch, which incorporates the change in the earlier patch, also includes the changes made in the patch at #6668.
comment:7 Changed 12 years ago by
- Summary changed from [with patch , needs review] allow users to test Sage script using system-wide Sage installation to [with patches , needs review] allow users to test Sage script using system-wide Sage installation
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.
comment:8 Changed 12 years ago by
- Reviewers set to Tim Dumol
- Summary changed from [with patches , needs review] allow users to test Sage script using system-wide Sage installation to [with patches , positive review] allow users to test Sage script using system-wide Sage installation
Patches work perfectly, and I've run several dozen doctests without any problems. Temporary files are deleted as promised. Nice job guys. Positive review.
comment:9 Changed 12 years ago by
- Merged in set to Sage 4.1.2.alpha3
- Resolution set to fixed
- Status changed from new to closed
- Summary changed from [with patches , positive review] allow users to test Sage script using system-wide Sage installation to [with patches, positive review] allow users to test Sage script using system-wide Sage installation
Merged in the script repository.
comment:10 Changed 12 years ago by
- Summary changed from [with patches, positive review] allow users to test Sage script using system-wide Sage installation to [with patch, positive review] allow users to test Sage script using system-wide Sage installation
comment:11 Changed 12 years ago by
- Merged in changed from Sage 4.1.2.alpha3 to Sage 4.1.2.alpha4
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.
comment:12 Changed 12 years ago by
See #7079 for a case where the current ticket breaks parallel doctesting.
The two files above are identical. One can be deleted.