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

regrtest ambiguous -S flag #57935

Closed
etukia mannequin opened this issue Jan 7, 2012 · 6 comments
Closed

regrtest ambiguous -S flag #57935

etukia mannequin opened this issue Jan 7, 2012 · 6 comments
Labels
docs Documentation in the Doc dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@etukia
Copy link
Mannequin

etukia mannequin commented Jan 7, 2012

BPO 13726
Nosy @orsenthil, @ezio-melotti, @voidspace
Files
  • issue13726-2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2012-01-14.13:09:11.153>
    created_at = <Date 2012-01-07.12:14:48.038>
    labels = ['type-bug', 'tests', 'docs']
    title = 'regrtest ambiguous -S flag'
    updated_at = <Date 2012-01-14.13:09:11.152>
    user = 'https://bugs.python.org/etukia'

    bugs.python.org fields:

    activity = <Date 2012-01-14.13:09:11.152>
    actor = 'orsenthil'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2012-01-14.13:09:11.153>
    closer = 'orsenthil'
    components = ['Documentation', 'Tests']
    creation = <Date 2012-01-07.12:14:48.038>
    creator = 'etukia'
    dependencies = []
    files = ['24236']
    hgrepos = []
    issue_num = 13726
    keywords = ['patch']
    message_count = 6.0
    messages = ['150792', '151242', '151243', '151250', '151251', '151252']
    nosy_count = 6.0
    nosy_names = ['orsenthil', 'ezio.melotti', 'michael.foord', 'docs@python', 'python-dev', 'etukia']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue13726'
    versions = ['Python 3.2', 'Python 3.3']

    @etukia
    Copy link
    Mannequin Author

    etukia mannequin commented Jan 7, 2012

    ./python -m test --help
    -S/--slow -- print the slowest 10 tests

    -S is used to continue running tests after an aborted run. It will
    maintain the order a standard run (ie, this assumes -r is not used).
    This is useful after the tests have prematurely stopped for some external
    reason and you want to start running from where you left off rather
    than starting from the beginning.

    in Lib/test/regrtest.py

    opts, args = getopt.getopt(sys.argv[1:], '...S...',
    [..., 'slow', ... , 'start=', ...])

    for o, a in opts:
        elif o in ('-S', '--start'):
            start = a
        elif o in ('-S', '--slow'):
            print_slow = True

    At the moment -S (no args) and --slow (no args) are the same, not what the documentation says and not how the code executes (-S goes with --start). Help says nothing about --start.

    --slow or --start needs a new short opt, and corrected documentation.

    @etukia etukia mannequin assigned docspython Jan 7, 2012
    @etukia etukia mannequin added docs Documentation in the Doc dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Jan 7, 2012
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 14, 2012

    New changeset 4fc5dfad766a by Senthil Kumaran in branch '3.2':
    bpo-13726 - Fix the ambiguous -S flag in regrtest. It is -o/--slow for printing the 10 slowest test.
    http://hg.python.org/cpython/rev/4fc5dfad766a

    New changeset 9a0efac5bbcb by Senthil Kumaran in branch '3.2':
    Adding the -o option for bpo-13726
    http://hg.python.org/cpython/rev/9a0efac5bbcb

    @orsenthil
    Copy link
    Member

    I add -o as a short form for --slow. regrtest was using getopt and this conflicting option was not caught. I see it is a bug than a feature so the change is made in 3.2 and 3.3
    default: b84f61fdcb4c and 6797e7458ad0

    Thanks for catching this bug, Erno Tukia.

    @etukia
    Copy link
    Mannequin Author

    etukia mannequin commented Jan 14, 2012

    --start requires an argument but short opt -S does not.

    in Lib/test/regrtest.py

    opts, args = getopt.getopt(sys.argv[1:], '...S...',
    [..., 'start=', ...])

    Patch included.

    @etukia etukia mannequin reopened this Jan 14, 2012
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 14, 2012

    New changeset c4919642fd25 by Senthil Kumaran in branch '3.2':
    Fix bpo-13726: -S accepts an argument just as --start.
    http://hg.python.org/cpython/rev/c4919642fd25

    New changeset 347f6305bd26 by Senthil Kumaran in branch 'default':
    merge from 3.2 - Fix bpo-13726: -S accepts an argument just as --start.
    http://hg.python.org/cpython/rev/347f6305bd26

    @orsenthil
    Copy link
    Member

    Fixed now. Thanks!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant