Closed Bug 747440 Opened 13 years ago Closed 10 years ago

getParsedLog.php should inject screenshots from base64 PNGs in failed buildlogs

Categories

(Tree Management Graveyard :: TBPL, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: humph, Unassigned)

Details

(Keywords: sheriffing-P2)

Often there are base64 PNGs for screenshots of the build machine when a test failed. In build logs they look like: 82388 ERROR TEST-UNEXPECTED-FAIL | /tests/content/media/test/test_timeupdate_small_files.html | Test timed out. args: ['arch', '-arch', 'i386', '/usr/sbin/screencapture', '-C', '-x', '-t', 'png', '/var/folders/Xr/Xr--yJnSEY0U11ET5NZuMU+++TM/-Tmp-/mozilla-test-fail_xWbqI7'] SCREENSHOT: data:image/png;base64,iVBORw0KGgoAAAANSU....\n It would be nice if, at the top of the page, where we have Summary links for the failed tests, we injected <img>s with those dataurls as srcs, so you could just look at what happened.
*great* idea. One tiny moderating detail: there can be a lot of big-ish images, so be sure to inject those img src at runtime on user request, rather than automatically, so we don't decode images we don't have to (decoding lots of big images can ultrajank your browser).
Here's a start: function renderScreenShots() { var preTags = document.getElementsByTagName('pre'), imgContainer = preTags[1], log = preTags[2].textContent, screenshotRegex = /^SCREENSHOT\: (data\:image\/png\;base64\,[^\n]+)\n/gm, matches, img; while ((matches = screenshotRegex.exec(log)) !== null) { img = new Image(); img.src = matches[1]; imgContainer.insertBefore(img, preTags[2]); } } As a bookmarklet: <a href="javascript:(function(){var preTags=document.getElementsByTagName('pre'),imgContainer=preTags[1],log=preTags[2].textContent,screenshotReg\ ex=/^SCREENSHOT\: (data\:image\/png\;base64\,[^\n]+)\n/gm,matches,img;while((matches=screenshotRegex.exec(log))!==null){img=new Image();img.src=m\ atches[1];imgContainer.insertBefore(img,preTags[2]);}})();">Extract Screenshots</a>
NOTE: the build log uses <pre><pre>...build log body here...</pre></pre> (and one more <pre> previous to that in the head matter), so this is tightly coupled to that layout.
Blocks: 778688
No longer blocks: 778688
Whiteboard: [sheriff-want]
Whiteboard: [sheriff-want]
OS: Mac OS X → All
Hardware: x86 → All
Product: Webtools → Tree Management
Product: Tree Management → Tree Management Graveyard
Bug 1151550 filed for Treeherder.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.