| Index: mozilla-tests/known-failures.pl
|
| ===================================================================
|
| --- mozilla-tests/known-failures.pl (revision 43940)
|
| +++ mozilla-tests/known-failures.pl (working copy)
|
| @@ -44,12 +44,13 @@
|
| sub debug;
|
| sub usage;
|
| sub parse_options;
|
| +sub escape_string;
|
| sub escape_pattern;
|
| sub unescape_pattern;
|
|
|
| # option arguments
|
|
|
| -my $option_desc = "b=s branch>b T=s buildtype>T R=s repo>R t=s testtype>t o=s os>o K=s kernel>K A=s arch>A M=s memory>M S=s speed>S z=s timezone>z l=s rawlogfile>l f=s failurelogfile>f r=s patterns>r O=s outputprefix>O D debug>D";
|
| +my $option_desc = "b=s branch>b T=s buildtype>T R=s repo>R t=s testtype>t o=s os>o K=s kernel>K A=s arch>A M=s memory>M z=s timezone>z J=s jsoptions>J l=s rawlogfile>l f=s failurelogfile>f r=s patterns>r O=s outputprefix>O D debug>D";
|
|
|
| my $testid;
|
| my $branch;
|
| @@ -61,11 +62,11 @@
|
| my $os;
|
| my $patterns;
|
| my $timezone;
|
| +my $jsoptions;
|
| my $outputprefix;
|
| my $arch;
|
| my $kernel;
|
| my $memory;
|
| -my $cpuspeed;
|
| my $debug = $ENV{DEBUG};
|
|
|
| # pattern variables
|
| @@ -82,14 +83,14 @@
|
| my $failuretesttypepattern;
|
| my $knownfailuretimezonepattern;
|
| my $failuretimezonepattern;
|
| +my $knownfailurejsoptionspattern;
|
| +my $failurejsoptionspattern;
|
| my $knownfailurearchpattern;
|
| my $failurearchpattern;
|
| my $knownfailurekernelpattern;
|
| my $failurekernelpattern;
|
| my $knownfailurememorypattern;
|
| my $failurememorypattern;
|
| -my $knownfailurecpuspeedpattern;
|
| -my $failurecpuspeedpattern;
|
|
|
| my @patterns;
|
| my $pattern;
|
| @@ -153,7 +154,7 @@
|
| }
|
|
|
| debug "loading patterns $patterns";
|
| -debug "pattern filter: ^TEST_ID=[^,]*, TEST_BRANCH=$knownfailurebranchpattern, TEST_REPO=$knownfailurerepopattern, TEST_BUILDTYPE=$knownfailurebuildtypepattern, TEST_TYPE=$knownfailuretesttypepattern, TEST_OS=$knownfailureospattern, TEST_KERNEL=$knownfailurekernelpattern, TEST_PROCESSORTYPE=$knownfailurearchpattern, TEST_MEMORY=$knownfailurememorypattern, TEST_CPUSPEED=$knownfailurecpuspeedpattern, TEST_TIMEZONE=$knownfailuretimezonepattern,";
|
| +debug "pattern filter: ^TEST_ID=[^,]*, TEST_BRANCH=$knownfailurebranchpattern, TEST_REPO=$knownfailurerepopattern, TEST_BUILDTYPE=$knownfailurebuildtypepattern, TEST_TYPE=$knownfailuretesttypepattern, TEST_OS=$knownfailureospattern, TEST_KERNEL=$knownfailurekernelpattern, TEST_PROCESSORTYPE=$knownfailurearchpattern, TEST_MEMORY=$knownfailurememorypattern, TEST_TIMEZONE=$knownfailuretimezonepattern, TEST_OPTIONS=$knownfailurejsoptionspattern,";
|
|
|
| open PATTERNS, "<$patterns" or die "Unable to open known failure patterns file $patterns: $!\n";
|
| while (<PATTERNS>) {
|
| @@ -167,7 +168,7 @@
|
| {
|
| debug "test $testid was not included during this run";
|
| }
|
| - elsif ($_ =~ /^TEST_ID=[^,]*, TEST_BRANCH=$knownfailurebranchpattern, TEST_REPO=$knownfailurerepopattern, TEST_BUILDTYPE=$knownfailurebuildtypepattern, TEST_TYPE=$knownfailuretesttypepattern, TEST_OS=$knownfailureospattern, TEST_KERNEL=$knownfailurekernelpattern, TEST_PROCESSORTYPE=$knownfailurearchpattern, TEST_MEMORY=$knownfailurememorypattern, TEST_CPUSPEED=$knownfailurecpuspeedpattern, TEST_TIMEZONE=$knownfailuretimezonepattern,/) {
|
| + elsif ($_ =~ /^TEST_ID=[^,]*, TEST_BRANCH=$knownfailurebranchpattern, TEST_REPO=$knownfailurerepopattern, TEST_BUILDTYPE=$knownfailurebuildtypepattern, TEST_TYPE=$knownfailuretesttypepattern, TEST_OS=$knownfailureospattern, TEST_KERNEL=$knownfailurekernelpattern, TEST_PROCESSORTYPE=$knownfailurearchpattern, TEST_MEMORY=$knownfailurememorypattern, TEST_TIMEZONE=$knownfailuretimezonepattern, TEST_OPTIONS=$knownfailurejsoptionspattern,/) {
|
| debug "adding pattern : $_";
|
| push @patterns, (escape_pattern($_));
|
| }
|
| @@ -180,7 +181,7 @@
|
|
|
| # create a working copy of the current failures which match the users selection
|
|
|
| -debug "failure filter: ^TEST_ID=[^,]*, TEST_BRANCH=$failurebranchpattern, TEST_REPO=$failurerepopattern, TEST_BUILDTYPE=$failurebuildtypepattern, TEST_TYPE=$failuretesttypepattern, TEST_OS=$failureospattern, TEST_KERNEL=$failurekernelpattern, TEST_PROCESSORTYPE=$failurearchpattern, TEST_MEMORY=$failurememorypattern, TEST_CPUSPEED=$failurecpuspeedpattern, TEST_TIMEZONE=$failuretimezonepattern, TEST_RESULT=FAIL[^,]*,/";
|
| +debug "failure filter: ^TEST_ID=[^,]*, TEST_BRANCH=$failurebranchpattern, TEST_REPO=$failurerepopattern, TEST_BUILDTYPE=$failurebuildtypepattern, TEST_TYPE=$failuretesttypepattern, TEST_OS=$failureospattern, TEST_KERNEL=$failurekernelpattern, TEST_PROCESSORTYPE=$failurearchpattern, TEST_MEMORY=$failurememorypattern, TEST_TIMEZONE=$failuretimezonepattern, TEST_OPTIONS=$failurejsoptionspattern, TEST_RESULT=FAIL[^,]*,/";
|
|
|
| if (defined($rawlogfile)) {
|
|
|
| @@ -198,7 +199,7 @@
|
|
|
| print ALLLOG "$_\n";
|
|
|
| - if ($_ =~ /^TEST_ID=[^,]*, TEST_BRANCH=$failurebranchpattern, TEST_REPO=$failurerepopattern, TEST_BUILDTYPE=$failurebuildtypepattern, TEST_TYPE=$failuretesttypepattern, TEST_OS=$failureospattern, TEST_KERNEL=$failurekernelpattern, TEST_PROCESSORTYPE=$failurearchpattern, TEST_MEMORY=$failurememorypattern, TEST_CPUSPEED=$failurecpuspeedpattern, TEST_TIMEZONE=$failuretimezonepattern, TEST_RESULT=FAIL[^,]*,/) {
|
| + if ($_ =~ /^TEST_ID=[^,]*, TEST_BRANCH=$failurebranchpattern, TEST_REPO=$failurerepopattern, TEST_BUILDTYPE=$failurebuildtypepattern, TEST_TYPE=$failuretesttypepattern, TEST_OS=$failureospattern, TEST_KERNEL=$failurekernelpattern, TEST_PROCESSORTYPE=$failurearchpattern, TEST_MEMORY=$failurememorypattern, TEST_TIMEZONE=$failuretimezonepattern, TEST_OPTIONS=$failurejsoptionspattern, TEST_RESULT=FAIL[^,]*,/) {
|
| debug "failure: $_";
|
| push @failures, ($_);
|
| print FAILURELOG "$_\n";
|
| @@ -234,7 +235,7 @@
|
| while (<FAILURES>) {
|
| chomp;
|
|
|
| - if ($_ =~ /^TEST_ID=[^,]*, TEST_BRANCH=$failurebranchpattern, TEST_REPO=$failurerepopattern, TEST_BUILDTYPE=$failurebuildtypepattern, TEST_TYPE=$failuretesttypepattern, TEST_OS=$failureospattern, TEST_KERNEL=$failurekernelpattern, TEST_PROCESSORTYPE=$failurearchpattern, TEST_MEMORY=$failurememorypattern, TEST_CPUSPEED=$failurecpuspeedpattern, TEST_TIMEZONE=$failuretimezonepattern, TEST_RESULT=FAIL[^,]*,/) {
|
| + if ($_ =~ /^TEST_ID=[^,]*, TEST_BRANCH=$failurebranchpattern, TEST_REPO=$failurerepopattern, TEST_BUILDTYPE=$failurebuildtypepattern, TEST_TYPE=$failuretesttypepattern, TEST_OS=$failureospattern, TEST_KERNEL=$failurekernelpattern, TEST_PROCESSORTYPE=$failurearchpattern, TEST_MEMORY=$failurememorypattern, TEST_TIMEZONE=$failuretimezonepattern, TEST_OPTIONS=$failurejsoptionspattern, TEST_RESULT=FAIL[^,]*,/) {
|
| debug "failure: $_";
|
| push @failures, ($_);
|
| }
|
| @@ -303,6 +304,8 @@
|
| my $pass = 0;
|
| my $changed = ($#patterns != -1);
|
|
|
| +debug "changed=$changed, \$#patterns=$#patterns, \$#failures=$#failures";
|
| +
|
| while ($changed) {
|
|
|
| $pass = $pass + 1;
|
| @@ -336,6 +339,8 @@
|
|
|
| }
|
|
|
| +debug "\$#excludedtests=$#excludedtests, \$#failures=$#failures";
|
| +
|
| foreach $excludedtest ( @excludedtests ) {
|
|
|
| if ($debug) {
|
| @@ -347,9 +352,13 @@
|
|
|
| @results = grep !m@$excludedtest@, @failures;
|
|
|
| + debug "\$#results=$#results, \$excludedtest=$excludedtest, \$#failures=$#failures";
|
| +
|
| @failures = @results;
|
| }
|
|
|
| +debug "possible regressions: \$#failures=$#failures";
|
| +
|
| open OUTPUT, ">$outputprefix-results-possible-regressions.log" or die "Unable to open $outputprefix-results-possible-regressions.log: $!";
|
|
|
| my $failure;
|
| @@ -386,8 +395,8 @@
|
| [-K|--kernel] kernel
|
| [-A|--arch] arch
|
| [-M|--memory] memory
|
| - [-S|--speed] speed
|
| [-z|--timezone] timezone
|
| + [-J|--jsoptions] jsoptions
|
| [-r|--patterns] patterns
|
| ([-f|--failurelogfile] failurelogfile|[-l|--logfile] rawlogfile])
|
| [-O|--outputprefix] outputprefix
|
| @@ -397,7 +406,7 @@
|
| =============== ============================================================
|
| -b branch branch 1.8.0, 1.8.1, 1.9.0, all
|
| -R repository CVS for 1.8.0, 1.8.1, 1.9.0 branches,
|
| - mercurial repository name for 1.9.1 branches
|
| + mercurial repository name for 1.9.1 and later branches
|
| (\`basename http://hg.mozilla.org/repository\`)
|
| -T buildtype build type opt, debug, all
|
| -t testtype test type browser, shell, all
|
| @@ -405,8 +414,8 @@
|
| -K kernel kernel, all or a specific pattern
|
| -A arch architecture, all or a specific pattern
|
| -M memory memory in Gigabytes, all or a specific pattern
|
| - -S speed speed, all or specific pattern
|
| -z timezone -0400, -0700, etc. default to user\'s zone
|
| + -J jsoptions JavaScript options
|
| -l rawlogfile raw logfile
|
| -f failurelogfile failure logfile
|
| -r patterns known failure patterns
|
| @@ -449,24 +458,23 @@
|
| elsif ($option eq "M") {
|
| $memory = $value;
|
| }
|
| - elsif ($option eq "S") {
|
| - $cpuspeed = $value;
|
| - if ($cpuspeed < 4)
|
| - {
|
| - $cpuspeed = 'slow';
|
| + elsif ($option eq "z") {
|
| + $timezone = $value;
|
| + }
|
| + elsif ($option eq "J") {
|
| + my (@s, $j);
|
| +
|
| + if (! $value) {
|
| + $jsoptions = 'none';
|
| }
|
| - elsif ($cpuspeed < 9)
|
| - {
|
| - $cpuspeed = 'medium';
|
| + else {
|
| + $value =~ s/(-\w) (\w)/$1$2/g;
|
| + @s = sort split / /, $value;
|
| + $j = join(" ", @s);
|
| + $j =~ s/(-\w)(\w)/$1 $2/g;
|
| + $jsoptions = $j;
|
| }
|
| - else
|
| - {
|
| - $cpuspeed = 'fast';
|
| - }
|
| }
|
| - elsif ($option eq "z") {
|
| - $timezone = $value;
|
| - }
|
| elsif ($option eq "r") {
|
| $patterns = $value;
|
| }
|
| @@ -486,7 +494,7 @@
|
| }
|
|
|
| if ($debug) {
|
| - print "branch=$branch, buildtype=$buildtype, testtype=$testtype, os=$os, kernel=$kernel, arch=$arch, memory=$memory, cpuspeed=$cpuspeed, timezone=$timezone, patterns=$patterns, rawlogfile=$rawlogfile failurelogfile=$failurelogfile, outputprefix=$outputprefix\n";
|
| + print "branch=$branch, buildtype=$buildtype, testtype=$testtype, os=$os, kernel=$kernel, arch=$arch, memory=$memory, timezone=$timezone, jsoptions=$jsoptions, patterns=$patterns, rawlogfile=$rawlogfile failurelogfile=$failurelogfile, outputprefix=$outputprefix\n";
|
| }
|
| Getopt::Mixed::cleanup();
|
|
|
| @@ -510,14 +518,14 @@
|
| $memory = 'all';
|
| }
|
|
|
| - if (!defined($cpuspeed)) {
|
| - $cpuspeed = 'all';
|
| - }
|
| -
|
| if (!defined($timezone)) {
|
| usage "missing timezone";
|
| }
|
|
|
| + if (!defined($jsoptions)) {
|
| + $jsoptions = 'none';
|
| + }
|
| +
|
| if (!defined($patterns)) {
|
| usage "missing patterns";
|
| }
|
| @@ -530,27 +538,18 @@
|
| usage "missing outputprefix";
|
| }
|
|
|
| - if ($branch eq "1.8.0") {
|
| - $knownfailurebranchpattern = "(1\\.8\\.0|\\.\\*)";
|
| - $failurebranchpattern = "1\\.8\\.0";
|
| - }
|
| - elsif ($branch eq "1.8.1") {
|
| - $knownfailurebranchpattern = "(1\\.8\\.1|\\.\\*)";
|
| - $failurebranchpattern = "1\\.8\\.1";
|
| - }
|
| - elsif ($branch eq "1.9.0") {
|
| - $knownfailurebranchpattern = "(1\\.9\\.0|\\.\\*)";
|
| - $failurebranchpattern = "1\\.9\\.0";
|
| - }
|
| - elsif ($branch eq "1.9.1") {
|
| - $knownfailurebranchpattern = "(1\\.9\\.1|\\.\\*)";
|
| - $failurebranchpattern = "1\\.9\\.1";
|
| - }
|
| - elsif ($branch eq "all") {
|
| + if ($branch eq "all") {
|
| $knownfailurebranchpattern = "[^,]*";
|
| $failurebranchpattern = "[^,]*";
|
| }
|
| + else {
|
| + $knownfailurebranchpattern = "($branch|.*)";
|
| + $knownfailurebranchpattern =~ s/\./\\./g;
|
|
|
| + $failurebranchpattern = "$branch";
|
| + $failurebranchpattern =~ s/\./\\./g;
|
| + }
|
| +
|
| if ($repo eq "all" || $repo eq ".*") {
|
| $knownfailurerepopattern = "[^,]*";
|
| $failurerepopattern = "[^,]*";
|
| @@ -630,25 +629,51 @@
|
| $failurememorypattern = "[^,]*";
|
| }
|
|
|
| - if ($cpuspeed ne "all") {
|
| - $knownfailurecpuspeedpattern = "(" . $cpuspeed . "|\\.\\*)";
|
| - $failurecpuspeedpattern = "$cpuspeed";
|
| + if ($timezone eq "all") {
|
| + $knownfailuretimezonepattern = "[^,]*";
|
| + $failuretimezonepattern = "[^,]*";
|
| }
|
| else {
|
| - $knownfailurecpuspeedpattern = "[^,]*";
|
| - $failurecpuspeedpattern = "[^,]*";
|
| + $knownfailuretimezonepattern = "(" . escape_string($timezone) . "|\\.\\*)";
|
| + $failuretimezonepattern = escape_string("$timezone");
|
| }
|
|
|
| - if ($timezone eq "all") {
|
| - $knownfailuretimezonepattern = "[^,]*";
|
| - $failuretimezonepattern = "[^,]*";
|
| + if ($jsoptions eq "all") {
|
| + $knownfailurejsoptionspattern = "[^,]*";
|
| + $failurejsoptionspattern = "[^,]*";
|
| }
|
| else {
|
| - $knownfailuretimezonepattern = "(" . $timezone . "|\\.\\*)";
|
| - $failuretimezonepattern = "$timezone";
|
| + $knownfailurejsoptionspattern = "(" . escape_string($jsoptions) . "|\\.\\*)";
|
| + $failurejsoptionspattern = escape_string("$jsoptions");
|
| }
|
|
|
| +}
|
|
|
| +sub escape_string {
|
| + my $s = shift;
|
| +
|
| + # replace unescaped regular expression characters in the
|
| + # string so they are not interpreted as regexp chars
|
| + # when matching descriptions. leave the escaped regexp chars
|
| + # `regexp` alone so they can be unescaped later and used in
|
| + # pattern matching.
|
| +
|
| + # see perldoc perlre
|
| +
|
| + $s =~ s/\\/\\\\/g;
|
| +
|
| + # escape non word chars that aren't surrounded by ``
|
| + $s =~ s/(?<!`)([$regchars])(?!`)/\\$1/g;
|
| + $s =~ s/(?<!`)([$regchars])(?=`)/\\$1/g;
|
| + $s =~ s/(?<=`)([$regchars])(?!`)/\\$1/g;
|
| +
|
| + # unquote the regchars
|
| + $s =~ s/\`([^\`])\`/$1/g;
|
| +
|
| + debug "escape_string : $s";
|
| +
|
| + return "$s";
|
| +
|
| }
|
|
|
| sub escape_pattern {
|
| @@ -661,25 +686,8 @@
|
|
|
| # debug "escape_pattern: before: $leading$trailing";
|
|
|
| - # replace unescaped regular expression characters in the
|
| - # description so they are not interpreted as regexp chars
|
| - # when matching descriptions. leave the escaped regexp chars
|
| - # `regexp alone so they can be unescaped later and used in
|
| - # pattern matching.
|
| + $trailing = escape_string($trailing);
|
|
|
| - # see perldoc perlre
|
| -
|
| - $trailing =~ s/\\/\\\\/g;
|
| -
|
| - # escape non word chars that aren't surrounded by ``
|
| - $trailing =~ s/(?<!`)([$regchars])(?!`)/\\$1/g;
|
| - $trailing =~ s/(?<!`)([$regchars])(?=`)/\\$1/g;
|
| - $trailing =~ s/(?<=`)([$regchars])(?!`)/\\$1/g;
|
| - # $trailing =~ s/(?<!`)(\W)(?!`)/\\$1/g;
|
| -
|
| - # unquote the regchars
|
| - $trailing =~ s/\`([^\`])\`/$1/g;
|
| -
|
| debug "escape_pattern : $leading$trailing";
|
|
|
| return "$leading$trailing";
|
|
|