Ticket #2624 (closed enhancement: fixed)

Opened 5 years ago

Last modified 4 years ago

[with patch, positive review] parallel testing: sage -tp foo/bar/file.py should assume 1 thread

Reported by: mabshoff Owned by: jhpalmieri
Priority: major Milestone: sage-4.1.2
Component: doctest coverage Keywords:
Cc: Work issues:
Report Upstream: Reviewers: Dan Drake
Authors: John Palmieri Merged in: Sage 4.1.2.alpha4
Dependencies: Stopgaps:

Description

Oops:

./sage -tp -long devel/sage/sage/plot/plot.py
Global iterations: 1
File iterations: 1
TeX files: 0
Usage: sage -t <files or directories>.
For more information, type 'sage -help'.

Attachments

trac_2624-ptest-scripts.patch Download (3.0 KB) - added by jhpalmieri 4 years ago.
apply to scripts repository

Change History

comment:1 Changed 5 years ago by gfurnish

  • Status changed from new to closed
  • Resolution set to invalid

Missing number of threads parameter, invalid.

comment:2 Changed 5 years ago by gfurnish

  • Status changed from closed to reopened
  • Resolution invalid deleted

This should be the responsiblity of sage-sage

comment:3 Changed 5 years ago by gfurnish

  • Owner changed from gfurnish to mabshoff
  • Status changed from reopened to new

comment:4 Changed 5 years ago by gfurnish

  • Summary changed from parallel testing: sage -tp foo/bar/file.py is broken to parallel testing: sage -tp foo/bar/file.py should assume 1 thread

comment:5 Changed 4 years ago by AlexGhitza

  • Type changed from defect to enhancement

comment:6 Changed 4 years ago by jhpalmieri

  • Owner changed from mabshoff to jhpalmieri
  • Status changed from new to assigned
  • Summary changed from parallel testing: sage -tp foo/bar/file.py should assume 1 thread to [with patch, needs review] parallel testing: sage -tp foo/bar/file.py should assume 1 thread
  • Authors set to John Palmieri

Here's a patch. If the first argument after "tp" can't be converted to an integer, this sets it to 1 and assumes that the first argument is part of the list of files. The patch also expands on the error messages, changes the usage warning from "Usage: sage -t" to "Usage: sage -tp", gives a pointer to "sage -advanced" for more help, and adds a corresponding string to the output of "sage -advanced".

comment:7 Changed 4 years ago by ddrake

With this patch, when I do something like "sage -tp fjfjfjfjfj", it doesn't tell me that I gave it a bad file:

drake@klee:/var/tmp/sage-4.1.2.alpha2$ ./sage -tp fjfjfj 
Global iterations: 1
File iterations: 1
Using cached timings to run longest doctests first.
Doctesting 0 files 
 
----------------------------------------------------------------------
All tests passed!
Timings have been updated.
Total time for all tests: 0.1 seconds

Also, when it makes an assumption about the number of threads, I'd like it to print that it's using 1 thread. (Mostly for my own reassurance.)

comment:8 follow-up: ↓ 9 Changed 4 years ago by jhpalmieri

With this patch, when I do something like "sage -tp fjfjfjfjfj", it doesn't tell me that I gave it a bad file:

I feel as though this belongs in another ticket. For what it's worth, previous authors of the file seem to have made this decision intentionally:

               else:
                    continue # prefer silence to: raise TypeError, "Unknown File %s" % F

Also, when it makes an assumption about the number of threads, I'd like it to print that it's using 1 thread. (Mostly for my own reassurance.)

That's easy enough to change; see the new patch. This version also sets numthreads to be no more than the number of files.

comment:9 in reply to: ↑ 8 Changed 4 years ago by ddrake

Replying to jhpalmieri:

With this patch, when I do something like "sage -tp fjfjfjfjfj", it doesn't tell me that I gave it a bad file:

I feel as though this belongs in another ticket. For what it's worth, previous authors of the file seem to have made this decision intentionally:

               else:
                    continue # prefer silence to: raise TypeError, "Unknown File %s" % F

Okay, that does look like another ticket.

Also, when it makes an assumption about the number of threads, I'd like it to print that it's using 1 thread. (Mostly for my own reassurance.)

That's easy enough to change; see the new patch. This version also sets numthreads to be no more than the number of files.

Those look like good changes. Magic 8-ball says...positive review likely.

comment:10 follow-ups: ↓ 11 ↓ 13 Changed 4 years ago by ddrake

Oops, there's a typo: numthreads = min(numthreads, len(files)) should be *after* files is populated; otherwise, a directory with tons of files counts as one file! If you move that bit to line 324 (after the populatefilelist(infiles) stanza), everything works as expected. With that change, I give this patch a positive review. John, after updating your patch, you can change the title to positive review.

Release manager: please check the files COPYING.txt, install, and spkg-install into the sage_scripts hg repo! Right now they're not tracked at all.

comment:11 in reply to: ↑ 10 Changed 4 years ago by jhpalmieri

  • Summary changed from [with patch, needs review] parallel testing: sage -tp foo/bar/file.py should assume 1 thread to [with patch, positive review] parallel testing: sage -tp foo/bar/file.py should assume 1 thread

Replying to ddrake:

Oops, there's a typo

Good catch. Fixed in the new patch.

Changed 4 years ago by jhpalmieri

apply to scripts repository

comment:12 Changed 4 years ago by jhpalmieri

  • Reviewers set to Dan Drake

comment:13 in reply to: ↑ 10 ; follow-up: ↓ 14 Changed 4 years ago by mvngu

Replying to ddrake:

Release manager: please check the files COPYING.txt, install, and spkg-install into the sage_scripts hg repo! Right now they're not tracked at all.

When packaging the Sage source tarball, the files COPYING.txt, install, and spkg-install all end up in the package sage_scripts.x.y.z.spkg. When building from source, those three files end up as

  • COPYING.txt becomes SAGE_ROOT/COPYING.txt --- The directory SAGE_ROOT is not tracked:
    [mvngu@sage sage-4.1.2.alpha2]$ hg st
    abort: There is no Mercurial repository here (.hg not found)!
    
  • install becomes SAGE_ROOT/spkg/install --- The directory SAGE_ROOT/spkg is not tracked:
    [mvngu@sage spkg]$ pwd
    /scratch/mvngu/release/sage-4.1.2.alpha2/spkg
    [mvngu@sage spkg]$ hg st
    abort: There is no Mercurial repository here (.hg not found)!
    
  • spkg-install becomes SAGE_ROOT/local/bin/sage-spkg-install --- The directory SAGE_ROOT/local/bin is indeed tracked.

As it now stand, the changes to spkg-install can be checked in to SAGE_ROOT/local/bin/sage-spkg-install. Changes for the other two files would need to be manually applied to the relevant files.

comment:14 in reply to: ↑ 13 Changed 4 years ago by ddrake

Replying to mvngu:

Replying to ddrake:

Release manager: please check the files COPYING.txt, install, and spkg-install into the sage_scripts hg repo! Right now they're not tracked at all.

When packaging the Sage source tarball, the files COPYING.txt, install, and spkg-install all end up in the package sage_scripts.x.y.z.spkg. When building from source, those three files end up as

  • COPYING.txt becomes SAGE_ROOT/COPYING.txt --- The directory SAGE_ROOT is not tracked:

[snip]

  • install becomes SAGE_ROOT/spkg/install --- The directory SAGE_ROOT/spkg is not tracked:

[snip]

  • spkg-install becomes SAGE_ROOT/local/bin/sage-spkg-install --- The directory SAGE_ROOT/local/bin is indeed tracked.

As it now stand, the changes to spkg-install can be checked in to SAGE_ROOT/local/bin/sage-spkg-install. Changes for the other two files would need to be manually applied to the relevant files.

Okay. It does seem weird that basic source files are not version controlled...but whatever. :) For the purposes of this ticket, you just need to merge the patch to sage-ptest.

comment:15 Changed 4 years ago by mvngu

  • Status changed from assigned to closed
  • Resolution set to fixed
  • Merged in set to Sage 4.1.2.alpha3

Merged in the script repository.

comment:16 Changed 4 years ago by mvngu

  • 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.

Note: See TracTickets for help on using tickets.