Closed Bug 428758 Opened 16 years ago Closed 16 years ago

runtests.py --help is confusing about logging level ordering

Categories

(Testing :: Mochitest, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dbaron, Unassigned)

Details

When I look at the --help output for runtests.py:

obj/firefox-debugopt/_tests/testing/mochitest $ python ./runtests.py --help

it says:

Logging levels are one of DEBUG, INFO, ERROR, FATAL, WARNING.

This is confusing because it's not clear which level is higher than which.  The normal expectation for logging levels is that specifying a level gives you messages for that level or any higher levels.  That seems to be the case here, but --help prints the levels out of order:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/testing/mochitest/runtests.py.in&rev=1.23&mark=118,180,182#118
when the real order is given here:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/testing/mochitest/MochiKit/Logging.js&rev=1.1&mark=252-256#250
(again out of order, but less importantly).

So I'd expect the above output to print that the possible levels are:
  DEBUG, INFO, WARNING, ERROR, FATAL
rather than list WARNING at the end.

(While I'm on the topic, maybe "CONSOLELEVEL" and "FILELEVEL" in the same output should both be "LOGLEVEL", and the sentence quoted above should refer to "LOGLEVEL is" rather than "Logging levels are".)
I moved all the log levels (reordered) into the log-level argument descriptions, which I thought seemed better (and dbaron agreed when I asked on IRC).  I also tweaked the FOO in --foo=FOO in the help message for several values of foo, and I made the --file-level argument no longer required if --log-file is specified by providing a default (INFO, since that seems most likely to be desired since you'd want to log successes and failures).

It didn't seem worthwhile to run this past someone because it's mostly visual verification of help messages; checkin is the following for anyone who wants to read it:

http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=mozilla/testing/mochitest&command=DIFF_FRAMESET&file=runtests.py.in&rev1=1.24&rev2=1.25&root=/cvsroot
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Moving a bunch of Core :: Testing bugs to Testing :: Mochitest to clear out the former, which is obsolete now that we have more specialized categories for such bugs; filter on the string "MochitestMmMm" to delete all these notifications.
Component: Testing → Mochitest
Flags: in-testsuite-
Product: Core → Testing
QA Contact: testing → mochitest
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.