Closed Bug 1421799 Opened 8 years ago Closed 8 years ago

Make 'mach' log format the default for |mach test| and |mach mochitest|

Categories

(Testing :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox59 fixed)

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: ahal, Assigned: ahal)

References

(Blocks 1 open bug)

Details

Attachments

(6 files, 1 obsolete file)

Currently running |mach test| or |mach mochitest| uses the 'tbpl' format by default. The mach format tends to be a bit nicer to read on a terminal with color support, it would be good to use this by default. It needs a bit of cleaning up though, it can be a bit verbose and seems to print None into the thread field a fair amount. This bug will first clean the format up a bit, and then make it the default.
Blocks: mach-test
Depends on: 1422302
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Attachment #8935154 - Flags: review?(gbrown)
Attachment #8935155 - Flags: review?(gbrown)
Attachment #8935156 - Flags: review?(gbrown)
Attachment #8935157 - Flags: review?(gbrown)
Attachment #8935158 - Flags: review?(gbrown)
This still depends on bug 1209463, but that bug shouldn't affect this bug too much, so might as well get the review process started.
Comment on attachment 8935154 [details] Bug 1421799 - [reftest] Log 'GECKO(<pid>)' instead of 'ProcessReader' for process_output log actions https://reviewboard.mozilla.org/r/206002/#review212018
Attachment #8935154 - Flags: review?(gbrown) → review+
Comment on attachment 8935155 [details] Bug 1421799 - [mochitest] Stop printing NOW RUNNING messages https://reviewboard.mozilla.org/r/206004/#review212126 Just voicing my opinion...no need to act on it. ::: testing/mochitest/mach_commands.py (Diff revision 2) > for (flavor, subsuite), tests in sorted(suites.items()): > fobj = ALL_FLAVORS[flavor] > - msg = fobj['aliases'][0] > - if subsuite: > - msg = '{} with subsuite {}'.format(msg, subsuite) > - print(NOW_RUNNING.format(msg)) I'm a little uncomfortable with removing this completely...I find it helpful to see the subsuite, when running multiple subsuites.
Attachment #8935155 - Flags: review?(gbrown) → review+
Comment on attachment 8935156 [details] Bug 1421799 - [mozlog] Improve the 'mach' formatter https://reviewboard.mozilla.org/r/206006/#review212134 ::: testing/mozbase/mozlog/mozlog/formatters/machformatter.py:52 (Diff revision 2) > > s = super(MachFormatter, self).__call__(data) > if s is None: > return > > - time = format_seconds(self._time(data)) > + time = self.term.dim_blue(format_seconds(self._time(data))) This feels a little "hard coded". I think it would be nice if there was one place in the code that mapped colours: time_color = blue error_color = red ...but I'm not clear on how to do that cleanly, and unsure if it is worth the effort.
Attachment #8935156 - Flags: review?(gbrown) → review+
Comment on attachment 8935157 [details] Bug 1421799 - [test] Add mozlog logging arguments to |mach test| and |mach mochitest| https://reviewboard.mozilla.org/r/206008/#review212138
Attachment #8935157 - Flags: review?(gbrown) → review+
Comment on attachment 8935158 [details] Bug 1421799 - [test] Make the 'mach' formatter the default when running |mach test| and |mach mochitest| https://reviewboard.mozilla.org/r/206010/#review212140 Seems like a good change -- looking forward to it.
Attachment #8935158 - Flags: review?(gbrown) → review+
I could not apply your patches cleanly, so didn't test these at all, but the changes look reasonable and I really like the look of your screenshot -- good stuff!
Comment on attachment 8935155 [details] Bug 1421799 - [mochitest] Stop printing NOW RUNNING messages https://reviewboard.mozilla.org/r/206004/#review212126 > I'm a little uncomfortable with removing this completely...I find it helpful to see the subsuite, when running multiple subsuites. Later on in this patch series, the mach formatter will print the suite name (including mochitest subsuite) as part of the SUITE_START message. It's not as visible as this though. The main reason I removed it was that it's mochitest specific, so when running `mach test` it's a little weird that it gets printed for some suites but not others. I'd also like to implement a terminal footer like |mach build| has which would have the currently running suite highlighted. I think this would be a better way of displaying this information, though I guess we could leave the current `print` statement as is until that gets landed.
Comment on attachment 8935156 [details] Bug 1421799 - [mozlog] Improve the 'mach' formatter https://reviewboard.mozilla.org/r/206006/#review212134 > This feels a little "hard coded". I think it would be nice if there was one place in the code that mapped colours: > > time_color = blue > error_color = red > > ...but I'm not clear on how to do that cleanly, and unsure if it is worth the effort. Yeah, ideally I'd like to do something like mercurial does, and allow colors to be tweaked in `machrc`. Maybe we could allow users to specify something like: [colors] log.suite_start = yellow log.process_output = blue ... I don't want to scope bloat this bug though, I filed bug 1424287 to tackle it in a follow up.
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bbe4d2292f86 [reftest] Log 'GECKO(<pid>)' instead of 'ProcessReader' for process_output log actions r=gbrown https://hg.mozilla.org/integration/autoland/rev/afe14ec646ab [mochitest] Stop printing NOW RUNNING messages r=gbrown https://hg.mozilla.org/integration/autoland/rev/2de335c0287a [mozlog] Improve the 'mach' formatter r=gbrown https://hg.mozilla.org/integration/autoland/rev/629e467a07be [test] Add mozlog logging arguments to |mach test| and |mach mochitest| r=gbrown https://hg.mozilla.org/integration/autoland/rev/7fb20bced076 [test] Make the 'mach' formatter the default when running |mach test| and |mach mochitest| r=gbrown
This was happening because I forgot to add mozterm to the test package. Sorry about that. This looks to be fixed with the latest series: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ce94b85bdeee612db9c87734ede29860b75d1d4f
Flags: needinfo?(ahalberstadt)
Attachment #8937078 - Flags: review?(gbrown)
Still broken on Android.
Attachment #8935158 - Attachment is obsolete: true
Attachment #8937078 - Flags: review?(gbrown)
Comment on attachment 8937078 [details] Bug 1421799 - [test_archive] Add 'mozterm' to common.tests.zip https://reviewboard.mozilla.org/r/207786/#review214468
Attachment #8937078 - Flags: review?(gbrown) → review+
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e028f677bc80 [test_archive] Add 'mozterm' to common.tests.zip r=gbrown https://hg.mozilla.org/integration/autoland/rev/8c1f1ab754a5 [reftest] Log 'GECKO(<pid>)' instead of 'ProcessReader' for process_output log actions r=gbrown https://hg.mozilla.org/integration/autoland/rev/88dca5c8cfac [mochitest] Stop printing NOW RUNNING messages r=gbrown https://hg.mozilla.org/integration/autoland/rev/18b4fa241936 [mozlog] Improve the 'mach' formatter r=gbrown https://hg.mozilla.org/integration/autoland/rev/f9f32474fdaf [test] Add mozlog logging arguments to |mach test| and |mach mochitest| r=gbrown
The autophone failures are being fixed in the upstream repo (it's out of tree). I guess I missed the firefox ui tests in my try run. I guess those don't use the tests.zip? Adding a new package dependency is proving to be more of a pain than I was hoping :(
Flags: needinfo?(ahalberstadt)
The firefox-ui-tests broke because the mozharness script wasn't configured to extract the 'mozterm' directory from the tests.zip. The autophone issue should also be fixed, just waiting on try results for both.
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5ee21ac1a6ec [test_archive] Add 'mozterm' to common.tests.zip r=gbrown https://hg.mozilla.org/integration/autoland/rev/419ba12cc0c8 [reftest] Log 'GECKO(<pid>)' instead of 'ProcessReader' for process_output log actions r=gbrown https://hg.mozilla.org/integration/autoland/rev/0ad440c6f93b [mochitest] Stop printing NOW RUNNING messages r=gbrown https://hg.mozilla.org/integration/autoland/rev/cee49b47add0 [mozlog] Improve the 'mach' formatter r=gbrown https://hg.mozilla.org/integration/autoland/rev/9b58dffaaa49 [test] Add mozlog logging arguments to |mach test| and |mach mochitest| r=gbrown
Andrew, where is the code of mozterm and are we planning to add it to the tree?
Flags: needinfo?(ahalberstadt)
It is in the tree under python/mozterm.
Flags: needinfo?(ahalberstadt)
(In reply to Andrew Halberstadt [:ahal] from comment #62) > It is in the tree under python/mozterm. Oh, I didn't thought about this folder. Would you mind to add a URL to the setup.py which points to the source? Right now it is not clear on PyPI where the source is located.
This is really awesome. I just don't know how to use it... is it possible to get this output already? how does one turn it on?
./mach mochitest devtools/client/storage/test/browser_storage_dynamic_updates_cookies.js --log-mach=- You can also set an alias: alias mochitest='./mach mochitest --log-mach=-'
Oh, that's embarrassing. This bug was supposed to make the 'mach' format default, but 'tbpl' is still the default: https://searchfox.org/mozilla-central/source/testing/mach_commands.py#67 I must have accidentally blown over that change while resolving conflicts or something and because I had: [test] format=mach in my ~/.mozbuild/machrc, I never noticed. I'll file a new bug to get this fixed. If you want this on in the meantime, feel free to add the above to your machrc too (you may need to create it). Also to note, reftest will still be excluded from this format as it is not compatible with the reftest-analyzer.
Blocks: 1444885
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: