`sage -t --log=file.log` broken in 9.5.beta5

41 views
Skip to first unread message

Sébastien Labbé

unread,
Nov 1, 2021, 12:36:18 PM11/1/21
to sage-devel
Bonjour,

I just noticed that providing a log file to the `sage -t` command is currently broken with the most recent version:

$ sage -v
SageMath version 9.5.beta5, Release Date: 2021-10-28

$ sage -t src/sage/rings/integer.pyx
sage -t --random-seed=71352052423083427285276605183088217936 src/sage/rings/integer.pyx
    [1145 tests, 3.32 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------


$ sage -t src/sage/rings/integer.pyx --log=a.log
Traceback (most recent call last):
  File "/home/slabbe/GitBox/sage/src/bin/sage-runtests", line 151, in <module>
    err = DC.run()
  File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/doctest/control.py", line 1251, in run
    self.expand_files_into_sources()
  File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/doctest/control.py", line 835, in expand_files_into_sources
    self.sources = [FileDocTestSource(path, self.options) for path in expand()]
  File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/doctest/control.py", line 835, in <listcomp>
    self.sources = [FileDocTestSource(path, self.options) for path in expand()]
  File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/doctest/sources.py", line 527, in __init__
    raise ValueError("unknown file extension %r"%ext)
ValueError: unknown file extension '.log'

Sébastien Labbé

unread,
Nov 1, 2021, 12:58:39 PM11/1/21
to sage-devel
Also, this used to work, but does not work currently:

$ sage -tp --memlimit=4000
usage: sage -t [options] filenames
sage-runtests: error: unrecognized arguments: --memlimit=4000

Michael Orlitzky

unread,
Nov 1, 2021, 1:15:37 PM11/1/21
to sage-...@googlegroups.com
The --memlimit option and the default memlimit itself were removed in
trac ticket 31395, commit cf0c05c000e96. The default memlimit served no
purpose; whenever the test suite ran out of memory, we would just raise
the default limit again. And the --memlimit option was basically only
useful to work around that issue until someone committed a higher
default limit.

If you really need to set a memory limit for some other reason, ulimit
or whatever your OS provides will work better.


Antonio Rojas

unread,
Nov 1, 2021, 2:00:59 PM11/1/21
to sage-devel
El lunes, 1 de noviembre de 2021 a las 17:36:18 UTC+1, Sébastien Labbé escribió:
Bonjour,

I just noticed that providing a log file to the `sage -t` command is currently broken with the most recent version:


This is caused by https://trac.sagemath.org/ticket/32332. All arguments must go before the file name now. 

Sébastien Labbé

unread,
Nov 2, 2021, 9:56:48 AM11/2/21
to sage-devel
Ok, I see. Then, maybe I would suggest to replace the error message:

ValueError: unknown file extension '.log'

by something like

ValueError: unknown extension '.log' for the file to test (expecting .py, pyx, .sage, spyx, .rst, others?)

which would make the error more understandable. I will create a ticket and post a link here.

Sébastien Labbé

unread,
Nov 2, 2021, 10:55:43 AM11/2/21
to sage-devel
> I will create a ticket and post a link here.

I created :

Sébastien Labbé

unread,
Nov 2, 2021, 10:56:47 AM11/2/21
to sage-devel
If you really need to set a memory limit for some other reason, ulimit
or whatever your OS provides will work better.

I was setting  --memlimit=4000 for exactly that reason. Thank you for getting rid of it.
 
Reply all
Reply to author
Forward
0 new messages