Closed
Bug 718106
Opened 14 years ago
Closed 14 years ago
run_tests.py should display help if no arguments are given
Categories
(Testing :: Talos, defect)
Testing
Talos
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: k0scist, Assigned: BYK)
Details
Attachments
(2 files, 1 obsolete file)
|
942 bytes,
patch
|
k0scist
:
review+
|
Details | Diff | Splinter Review |
|
1.29 KB,
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
currently running `python run_tests.py` displays no output and exits
0. Instead, it should run `parser.print_help()` and also probably
exit 0.
| Reporter | ||
Updated•14 years ago
|
Whiteboard: [good first bug][mentor=jhammel][lang=py]
| Assignee | ||
Comment 1•14 years ago
|
||
I would love to take on this with argparse module though I think we need to wait for it a little longer.
| Reporter | ||
Comment 2•14 years ago
|
||
argparse would be great to have, though i wouldn't want to block anything related to talos command line handling on it. Even using optparse, we have a ton of things that should be made better (example: the handling of --activeTests via colon separators)
| Assignee | ||
Comment 3•14 years ago
|
||
I put the check *before* parsing the arguments since the help text only mentions [options] and printing the help text when some options provided but no "actual" arguments are given does not make much sense in IMO.
| Reporter | ||
Comment 4•14 years ago
|
||
Comment on attachment 589129 [details] [diff] [review]
Patch for printing help string if no arguments are given at all
We should put this after the `parser.parse_args` call since, as is, you can still get in the situation of `python run_tests.py -d` which is just as confusing (and which a user evaluating program usage from the CLI would be lead to do after `python run_tests.py` with no arguments. Instead, we should just make the usage more helpful; e.g. http://hg.mozilla.org/build/talos/file/d93f2b21985c/talos/run_tests.py#l581 passing in usage="%prog [options] manifest.yml <manifest.yml> <...>"
Attachment #589129 -
Flags: review?(jhammel) → review-
| Assignee | ||
Comment 5•14 years ago
|
||
I made the changes according to the review. Changed the proposed usage string a little bit to be compliant with the argparse standard generated output(see examples in http://docs.python.org/library/argparse.html)
Attachment #589129 -
Attachment is obsolete: true
Attachment #589287 -
Flags: review?(jhammel)
| Reporter | ||
Comment 6•14 years ago
|
||
Comment on attachment 589287 [details] [diff] [review]
Print help if no actual arguments are provided
nice :) thanks!
Attachment #589287 -
Flags: review?(jhammel) → review+
| Reporter | ||
Updated•14 years ago
|
Whiteboard: [good first bug][mentor=jhammel][lang=py] → [good first bug][mentor=jhammel][lang=py][talos-checkin-needed]
| Reporter | ||
Comment 7•14 years ago
|
||
Was going to push to try, but the patch seems to have bitrotted
| Reporter | ||
Comment 8•14 years ago
|
||
Attachment #595513 -
Flags: review?(jmaher)
Comment 9•14 years ago
|
||
Comment on attachment 595513 [details] [diff] [review]
unbitrot
Review of attachment 595513 [details] [diff] [review]:
-----------------------------------------------------------------
::: talos/run_tests.py
@@ +574,5 @@
>
> def main(args=sys.argv[1:]):
>
> # parse command line options
> + usage = "%prog [options] manifest.yml [manifest.yml ...]"
hmm, do we use this string? I assume the parser.print_help() does it automatically, just thought we had to define it in a class or assign it some how.
Attachment #595513 -
Flags: review?(jmaher) → review+
Comment 10•14 years ago
|
||
this is a check outside of the config generation and runtime, landed:
http://hg.mozilla.org/build/talos/rev/2c84941f35ed
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [good first bug][mentor=jhammel][lang=py][talos-checkin-needed]
| Reporter | ||
Comment 11•14 years ago
|
||
(In reply to Joel Maher (:jmaher) from comment #9)
> Comment on attachment 595513 [details] [diff] [review]
> unbitrot
>
> Review of attachment 595513 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: talos/run_tests.py
> @@ +574,5 @@
> >
> > def main(args=sys.argv[1:]):
> >
> > # parse command line options
> > + usage = "%prog [options] manifest.yml [manifest.yml ...]"
>
> hmm, do we use this string? I assume the parser.print_help() does it
> automatically, just thought we had to define it in a class or assign it some
> how.
Beh, was supposed to pass in as
parser = PerfConfigurator.TalosOptions(usage=usage)
It would be a good follow-up, though even as is its infinitely better than it was before. Thanks, BYK, and sorry for the long turnaround.
You need to log in
before you can comment on or make changes to this bug.
Description
•