Bug 667266 - Microscopically speed up processbuild.pl by dropping some '90s output formats, r=bear
git-svn-id: svn://10.0.0.236/trunk@262427 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
df48e958de
commit
2a8ac5c9a7
@ -48,11 +48,7 @@ if ($mode_count > 1) {
|
||||
&do_express(\%form), exit if $form{express};
|
||||
&do_rdf(\%form), exit if $form{rdf};
|
||||
&do_static(\%form), exit if $form{static};
|
||||
&do_flash(\%form), exit if $form{flash};
|
||||
&do_panel(\%form), exit if $form{panel};
|
||||
&do_hdml(\%form), exit if $form{hdml};
|
||||
&do_vxml(\%form), exit if $form{vxml};
|
||||
&do_wml(\%form), exit if $form{wml};
|
||||
&do_json(\%form), exit if $form{json};
|
||||
&do_json2(\%form), exit if $form{json2};
|
||||
&do_status(\%form), exit if $form{status};
|
||||
|
||||
@ -81,13 +81,10 @@ sub do_static($) {
|
||||
$form_ref->{legend}=0;
|
||||
|
||||
my @pages = ( ['index.html', 'do_tinderbox'],
|
||||
['flash.rdf', 'do_flash'],
|
||||
['panel.html', 'do_panel'],
|
||||
['quickparse.txt', 'do_quickparse'],
|
||||
['stats.hdml', 'do_hdml'],
|
||||
['json.js', 'do_json'],
|
||||
['json2.js', 'do_json2'],
|
||||
['status.vxml', 'do_vxml'],
|
||||
['status.html', 'do_status'] );
|
||||
|
||||
my ($key, $value);
|
||||
@ -1070,73 +1067,6 @@ sub do_panel($) {
|
||||
print "</table></body>";
|
||||
}
|
||||
|
||||
sub do_flash($) {
|
||||
my ($form_ref) = (@_);
|
||||
my $tree = &require_only_one_tree($form_ref->{tree});
|
||||
|
||||
print "Content-Type: text/rdf; charset=utf-8\n\n" unless $form_ref->{static};
|
||||
|
||||
my (%quickdata);
|
||||
tb_loadquickparseinfo($tree, $form_ref->{maxdate}, \%quickdata);
|
||||
|
||||
my ($mac,$unix,$win) = (0,0,0);
|
||||
|
||||
foreach my $name (keys %quickdata) {
|
||||
next if $quickdata{$name}->{buildstatus} eq 'success';
|
||||
$mac = 1, next if $name =~ /Mac/;
|
||||
$win = 1, next if $name =~ /Win/;
|
||||
$unix = 1;
|
||||
}
|
||||
|
||||
print q{
|
||||
<RDF:RDF xmlns:RDF='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
|
||||
xmlns:NC='http://home.netscape.com/NC-rdf#'>
|
||||
<RDF:Description about='NC:FlashRoot'>
|
||||
};
|
||||
|
||||
my $busted = $mac + $unix + $win;
|
||||
if ($busted) {
|
||||
|
||||
# Construct a legible sentence; e.g., "Mac, Unix, and Windows
|
||||
# are busted", "Windows is busted", etc. This is hideous. If
|
||||
# you can think of something better, please fix it.
|
||||
|
||||
my $text;
|
||||
if ($mac) {
|
||||
$text .= 'Mac' . ($busted > 2 ? ', ' : ($busted > 1 ? ' and ' : ''));
|
||||
}
|
||||
if ($unix) {
|
||||
$text .= 'Unix' . ($busted > 2 ? ', and ' : ($win ? ' and ' : ''));
|
||||
}
|
||||
if ($win) {
|
||||
$text .= 'Windows';
|
||||
}
|
||||
$text .= ($busted > 1 ? ' are ' : ' is ') . 'busted';
|
||||
|
||||
# The Flash spec says we need to give ctime.
|
||||
use POSIX;
|
||||
my $tm = POSIX::ctime(time());
|
||||
$tm =~ s/^...\s//; # Strip day of week
|
||||
$tm =~ s/:\d\d\s/ /; # Strip seconds
|
||||
chop $tm;
|
||||
|
||||
print qq{
|
||||
<NC:child>
|
||||
<RDF:Description ID='flash'>
|
||||
<NC:type resource='http://www.mozilla.org/RDF#TinderboxFlash' />
|
||||
<NC:source>$tree</NC:source>
|
||||
<NC:description>$text</NC:description>
|
||||
<NC:timestamp>$tm</NC:timestamp>
|
||||
</RDF:Description>
|
||||
</NC:child>
|
||||
};
|
||||
}
|
||||
print q{
|
||||
</RDF:Description>
|
||||
</RDF:RDF>
|
||||
};
|
||||
}
|
||||
|
||||
sub do_quickparse($) {
|
||||
my ($form_ref) = (@_);
|
||||
|
||||
@ -1221,174 +1151,4 @@ sub do_rdf($) {
|
||||
print "</rdf:RDF>\n";
|
||||
}
|
||||
|
||||
# This is for Sprint phones
|
||||
sub do_hdml($) {
|
||||
my ($form_ref) = (@_);
|
||||
my $tree = &require_only_one_tree($form_ref->{tree});
|
||||
|
||||
print "Content-Type: text/hdml; charset=utf-8\n\n" unless $form_ref->{static};
|
||||
|
||||
print q{<hdml public=true version=2.0 ttl=0>
|
||||
<display title=Tinderbox>
|
||||
<action type=help task=go dest=#help>
|
||||
};
|
||||
my %state_symbols = (success=>'+',busted=>'!',testfailed=>'~',exception=>'?');
|
||||
|
||||
if (&is_tree_state_available($tree)) {
|
||||
print "<LINE>$tree is " . (&is_tree_open($tree) ? 'open' : 'closed');
|
||||
}
|
||||
my (%quickdata);
|
||||
tb_loadquickparseinfo($tree, $form_ref->{maxdate}, \%quickdata);
|
||||
|
||||
foreach my $buildname (sort keys %quickdata) {
|
||||
print "<LINE>$state_symbols{$quickdata{$buildname}->{buildstatus}} $buildname\n";
|
||||
}
|
||||
|
||||
print q{
|
||||
</display>
|
||||
<DISPLAY NAME=help>
|
||||
Legend:<BR>
|
||||
+ : Good Build<BR>
|
||||
! : Broken Build<BR>
|
||||
~ : Tests Failed
|
||||
</DISPLAY>
|
||||
</HDML>
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
sub do_vxml($) {
|
||||
my ($form_ref) = (@_);
|
||||
my $tree = &require_only_one_tree($form_ref->{tree});
|
||||
|
||||
print "Content-Type: text/vxml; charset=utf-8\n\n";
|
||||
print '<?xml version="1.0"?><!DOCTYPE vxml PUBLIC "-//Tellme Networks//Voice Markup Language 1.0//EN" "http://resources.tellme.com/toolbox/vxml-tellme.dtd">';
|
||||
|
||||
print '<vxml><form id="tinderbox"><block>';
|
||||
print "\n\n";
|
||||
print '<audio src="http://www.boulderdesign.com/sounds/wargames.wav">Welcome</audio>';
|
||||
print "\n";
|
||||
print '<pause>500</pause>';
|
||||
print "\n";
|
||||
|
||||
my %state_symbols = (success=>'green.',busted=>'red.',testfailed=>'orange.',exception=>'purple.');
|
||||
|
||||
if (&is_tree_state_available($tree)) {
|
||||
print "<audio>$tree is " . (&is_tree_open($tree) ? 'open.' : 'closed.') . "</audio>";
|
||||
}
|
||||
my (%quickdata);
|
||||
tb_loadquickparseinfo($tree, $form_ref->{maxdate}, \%quickdata);
|
||||
|
||||
my $testFailed = 0;
|
||||
my $flames = 0;
|
||||
|
||||
print "\n";
|
||||
foreach my $buildname (sort keys %quickdata) {
|
||||
if ($quickdata{$buildname}->{buildstatus} eq 'busted') {
|
||||
$flames = 1;
|
||||
} elsif ($quickdata{$buildname}->{buildstatus} eq 'testfailed') {
|
||||
$testFailed = 1;
|
||||
}
|
||||
}
|
||||
print '<pause>500</pause>';
|
||||
|
||||
if ($testFailed == 1 || $flames == 1) {
|
||||
if ($testFailed == 1) {
|
||||
print '<audio src="http://www.boulderdesign.com/sounds/hansolo_badfeeling.wav">a test failed</audio>';
|
||||
} elsif ($flames == 1) {
|
||||
print '<audio src="http://www.boulderdesign.com/sounds/brimstone.wav">something is on fire</audio>';
|
||||
}
|
||||
print "\n";
|
||||
|
||||
foreach my $buildname (sort keys %quickdata) {
|
||||
print "<pause>500</pause>";
|
||||
print "\n";
|
||||
if ($quickdata{$buildname}->{buildstatus} eq 'busted' ||
|
||||
$quickdata{$buildname}->{buildstatus} eq 'testfailed') {
|
||||
print '<audio src="http://www.boulderdesign.com/sounds/getfixed.wav">bustage</audio>';
|
||||
print "\n";
|
||||
}
|
||||
|
||||
print "<pause>500</pause>";
|
||||
print "\n";
|
||||
print "<audio>$buildname is $state_symbols{$quickdata{$buildname}->{buildstatus}} </audio>";
|
||||
print "\n";
|
||||
}
|
||||
} else {
|
||||
print '<audio>All clear, move along.</audio>';
|
||||
print "\n";
|
||||
}
|
||||
|
||||
print '<pause>1000</pause><audio src="http://www.boulderdesign.com/sounds/goodbye.wav">goodbye</audio>';
|
||||
print "\n";
|
||||
print '<disconnect/></block></form></vxml>';
|
||||
}
|
||||
|
||||
sub do_wml($) {
|
||||
my ($form_ref) = (@_);
|
||||
my $tree = &require_only_one_tree($form_ref->{tree});
|
||||
|
||||
print "Content-Type: text/vnd.wap.wml; charset=utf-8\n";
|
||||
print "Pragma: No-Cache\n\n";
|
||||
|
||||
print '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">';
|
||||
|
||||
print '<wml><card id="Status" title="Status">';
|
||||
print '<do type="accept" label="Builds"><go href="#Builds"/></do>';
|
||||
print '<p align ="center"><b><u>Moz Tinderbox</u></b></p>';
|
||||
|
||||
my %state_symbols = (success=>'green.',busted=>'red.',testfailed=>'orange.',exception=>'purple.');
|
||||
|
||||
if (&is_tree_state_available($tree)) {
|
||||
print "<p align='left'>$tree is " . (&is_tree_open($tree) ? 'open.' : 'closed.') . "</p>";
|
||||
}
|
||||
my (%quickdata);
|
||||
tb_loadquickparseinfo($tree, $form_ref->{maxdate}, \%quickdata);
|
||||
|
||||
my $testFailed = 0;
|
||||
my $flames = 0;
|
||||
|
||||
print "\n";
|
||||
foreach my $buildname (sort keys %quickdata) {
|
||||
if ($quickdata{$buildname}->{buildstatus} eq 'busted') {
|
||||
$flames = 1;
|
||||
} elsif ($quickdata{$buildname}->{buildstatus} eq 'testfailed') {
|
||||
$testFailed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
print '<p align="left">';
|
||||
if ($flames) {
|
||||
print "There's bustage.</p>";
|
||||
}
|
||||
if ($testFailed) {
|
||||
print "Tests are failing.</p>";
|
||||
}
|
||||
|
||||
if ($flames == 0 && $testFailed == 0) {
|
||||
print "No bustage.</p>";
|
||||
}
|
||||
print "</card>\n";
|
||||
|
||||
print '<card id="Builds" title="Builds">';
|
||||
print '<p align="center"><b><u>Builds</u></b></p>';
|
||||
print '<p mode="nowrap"><table columns="2">';
|
||||
|
||||
foreach my $buildname (sort keys %quickdata) {
|
||||
print "<tr><td>[";
|
||||
if ($quickdata{$buildname}->{buildstatus} eq 'busted') {
|
||||
print '<b>RED</b>';
|
||||
} elsif ($quickdata{$buildname}->{buildstatus} eq 'exception') {
|
||||
print '<b>PURPLE</b>';
|
||||
} elsif ($quickdata{$buildname}->{buildstatus} eq 'testfailed') {
|
||||
print '<b>TEST FAILED</b>';
|
||||
} else {
|
||||
print 'GREEN';
|
||||
}
|
||||
print "]</td><td>$buildname</td></tr>";
|
||||
print "\n";
|
||||
}
|
||||
print '</table></p></card></wml>';
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user