Closed Bug 756515 Opened 13 years ago Closed 13 years ago

Log files are not being created

Categories

(Mozilla QA Graveyard :: Mozmill Automation, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: davehunt, Assigned: davehunt)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

It appears that bug 732134 introduced a regression in the support of log file. Specifying --logfile or -l no longer creates a log file.
I've investigated locally, and because the logfile is set on __init__ I suspect we would need to pass through the command line arguments. I've tried removing the line 'del sys.argv[1:]' and the log file starts to work. I also found that doing this allows us to pass through the --port and --profile arguments too. I'll attach a patch shortly.
Assignee: nobody → dave.hunt
Status: NEW → ASSIGNED
Attachment #625171 - Flags: review?(hskupin)
Apologies for not catching this earlier. This patch will fix the issue but will introduce the problems that deleting the system arguments was trying to solve -- TestRun has options that the Mozmill CLI does not have and it will cause an error when it is time to parse it. For example, using --junit with this patch will throw a "no such option" error. One approach would be to delete all the arguments that should not be carried to the CLI: > del sys.argv[1:] > if self.options.logfile: > sys.argv.append('--logfile=' + self.options.logfile) A bit of a hack, but offers more reliability than changing Mozmill code. What do you think?
Ah, I see! I clearly didn't test my patch much - I figured there must be a good reason for deleting the system arguments. The suggestion looks fine to me. Henrik?
Comment on attachment 625171 [details] [diff] [review] Restore logfile functionality. v1.0 As David said we cannot do this but I'm happy to use: http://docs.python.org/library/optparse.html#optparse-option-callbacks We for whichever option we have to re-set for Mozmill we can have generic code to do so.
Attachment #625171 - Flags: review?(hskupin) → review-
This patch uses a callback. Tested with log, port, and profile arguments.
Attachment #625171 - Attachment is obsolete: true
Attachment #637471 - Flags: review?(hskupin)
Comment on attachment 637471 [details] [diff] [review] Restore logfile functionality. v2.0 This looks good Dave! The only thing it misses to put into the Mozmill args is the --report option. But I don't think we can do anything here. So lets get this part fixed for the Mozmill 2.0 case.
Attachment #637471 - Flags: review?(hskupin) → review+
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: