[Pkg-mozext-commits] [compactheader] 296/441: Download builds for tests in parallel. Fixed download link for lightning (aurora)

David Prévot taffit at moszumanska.debian.org
Wed Mar 18 12:29:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository compactheader.

commit 85520331fae2eeed4acab6f0cd86e087eccfe205
Author: joachim <none at none>
Date:   Thu Oct 20 23:52:59 2011 +0200

    Download builds for tests in parallel. Fixed download link for lightning (aurora)
    
    --HG--
    branch : download_builds
---
 test/executeTests.pl | 195 ++++++++++++++++++++++++++++++---------------------
 test/testapps.csv    |   2 +-
 2 files changed, 118 insertions(+), 79 deletions(-)

diff --git a/test/executeTests.pl b/test/executeTests.pl
index db8592c..a50fdbd 100644
--- a/test/executeTests.pl
+++ b/test/executeTests.pl
@@ -51,7 +51,7 @@ print "xpi: $xpi\n";
 
 my $ftpdir = "ftp";
 
-my ($ostype,$hosttype,$version,$ftppath,$app,$tests,$lightning,$checksums);
+my ($ostype,$hosttype,$version,$ftppath,$app,$tests,$lightning,$checksum);
 my ($unpack, $unpackargs, $unpacktargetargs, $appbin, $virtualpython);
 my ($sysname, $nodename, $release, $osversion, $machine) = POSIX::uname();
 
@@ -74,123 +74,162 @@ elsif ($^O eq "linux") {
   $virtualpython = "../mozmill-virtualenv/bin/python";
 }
 
+my @children;
+my @files;
+my $dispMUAfile;
+my $dispMUA = "https://addons.mozilla.org/thunderbird/downloads/latest/562/addon-562-latest.xpi";
+my %testSpecs;
+
+system "wget", "-q", "-P", "$ftpdir", "-N", "$dispMUA";
+my @dispMUAfiles = glob("$ftpdir/display_*");
+$dispMUAfile = $dispMUAfiles[-1];
+
 while (my $line = <F>)
 {
-  ($ostype,$hosttype,$ftppath,$app,$tests,$checksums, $lightning) =
+  ($ostype,$hosttype,$ftppath,$app,$tests,$checksum, $lightning) =
     parse_csv($line);
   next if (not defined($ostype));
 
-  my $dispMUA = "https://addons.mozilla.org/thunderbird/downloads/latest/562/addon-562-latest.xpi";
 #  print "$ostype\t$hosttype\t$ftppath\t$app\t$tests\n";
 
-#  next if ($version lt "9.0");
-
   if (($ostype eq $^O)
       && ($hosttype eq $machine)
       ) {
-
     # Download checksums file to determine version of Thunderbird, because
     # we use a link to latest release/beta/earlybird/trunk build and do not
     # know the version!
     #    wget -r -l1 --no-parent --follow-ftp -A .checksums  '' -nd
-    my @files = glob("$ftpdir/thunderbird*$checksums");
+    my @files = glob("$ftpdir/thunderbird*$checksum");
     foreach my $file (@files) {
       unlink($file);
     }
     # print "wget -r -l1 --no-parent --follow-ftp -A$checksums $ftppath -nd -P $ftpdir 2>&1\n";
-    `wget -r -l1 --no-parent --follow-ftp -A$checksums $ftppath -nd -P $ftpdir 2>&1`;
-    @files = glob("$ftpdir/thunderbird*$checksums");
+    `wget -r -l1 --no-parent --follow-ftp -A$checksum $ftppath -nd -P "$ftpdir" 2>&1`;
+    @files = glob("$ftpdir/thunderbird*$checksum");
 
     my $file = $files[0];
 
-    $file =~ /thunderbird-(.*)$checksums/;
+    $file =~ /thunderbird-(.*)$checksum/;
     $version = $1;
+    # next if ($version lt "9.0");
 
     # $ftppath =~ s/_VER_/${version}/g;
     $app =~ s/_VER_/${version}/g;
     $tests =~ s/_VER_/${version}/g;
 
-    print "$ostype\t$hosttype\t$version\t$ftppath\t$app\t$tests\n";
+    # fork to run tests in parallel
+    my $pid = fork();
+    if ($pid) {
+      # parent
+#      print "pid: $pid\n";
+      $testSpecs{$pid} = {
+        version  => $version,
+        appbin   => $appbin,
+        tests    => $tests,
+        ostype   => $ostype,
+        hosttype => $hosttype,
+      };
+      push(@children, $pid);
+    } elsif (not defined $pid) {
+      die "couldn't fork: $!\n";
+    } else {
+      # child
+
+      print "child: $ostype\t$hosttype\t$ftppath\t$app\t$tests\n";
+
+      my $testdir = "test-$version";
+
+      mkdir "$testdir";
+      system "wget", "-q", "-P", "$ftpdir/$ostype-$hosttype-$version", "-N", "$ftppath/$app";
+      system "wget", "-q", "-P", "$ftpdir/$ostype-$hosttype-$version", "-N", "$ftppath/$tests";
+      system "wget", "-q", "-P", "$ftpdir/$ostype-$hosttype-$version", "-N", "$lightning";
+
+      system $unpack, $unpackargs, "$ftpdir//$ostype-$hosttype-$version/$app", $unpacktargetargs, $testdir;
+      system "unzip", "-q", "-o", "$ftpdir//$ostype-$hosttype-$version/$tests", "-d", $testdir, "-x", "*mochitest*", "*xpcshell*";
+
+      my $currentdir = getcwd;
+
+      # "Link" the add-on tests into the mozmill directory
+      if ($^O eq "msys") {
+        # Do not delete the test-xxx directory! Otherwise not only the link to
+        # the compactheader directory will be removed but also all files inside
+        # it (i.e. in the source directory).
+        `junction -d $testdir/mozmill/compactheader`;
+        `junction $testdir/mozmill/compactheader compactheader`;
+      }
+      else {
+        system "ln", "-sfn", qq[$currentdir/compactheader], qq[$testdir/mozmill/compactheader];
+      }
 
-    my $testdir = "test-$version";
+      # copy drag'n'drop helpers to shared-modules until they are added to thunderbird source
+      my @shared_files = glob("shared-modules/*");
+      foreach my $file (@shared_files) {
+        if (! -e "$testdir/mozmill/shared-modules/$file") {
+          copy("$file","$testdir/mozmill/shared-modules");
+        }
+      }
 
-    mkdir "$testdir";
-    system "wget", "-q", "-P", "$ftpdir/$ostype-$hosttype-$version", "-N", "$ftppath/$app";
-    system "wget", "-q", "-P", "$ftpdir/$ostype-$hosttype-$version", "-N", "$ftppath/$tests";
-    system "wget", "-q", "-P", "$ftpdir/$ostype-$hosttype-$version", "-N", "$lightning";
-    system "wget", "-q", "-P", "$ftpdir/$ostype-$hosttype-$version", "-N", "$dispMUA";
+      exit(0);
+    } # child
+  } # correct OS/architecture
+} # different versions
 
-    my @dispMUAfiles = glob("$ftpdir/$ostype-$hosttype-$version/display_*");
-    my $dispMUAfile = $dispMUAfiles[-1];
 
-    system $unpack, $unpackargs, "$ftpdir//$ostype-$hosttype-$version/$app", $unpacktargetargs, $testdir;
-    system "unzip", "-q", "-o", "$ftpdir//$ostype-$hosttype-$version/$tests", "-d", $testdir, "-x", "*mochitest*", "*xpcshell*";
+foreach my $pid (@children) {
+  waitpid($pid, 0);
+  my $currentdir = getcwd;
 
-    my $currentdir = getcwd;
+  $version  = $testSpecs{$pid}{version};
+  $appbin   = $testSpecs{$pid}{appbin};
+  $tests    = $testSpecs{$pid}{tests};
+  $ostype   = $testSpecs{$pid}{ostype};
+  $hosttype = $testSpecs{$pid}{hosttype};
 
-    # "Link" the add-on tests into the mozmill directory
-    if ($^O eq "msys") {
-      # Do not delete the test-xxx directory! Otherwise not only the link to
-      # the compactheader directory will be removed but also all files inside
-      # it (i.e. in the source directory).
-      `junction -d $testdir/mozmill/compactheader`;
-      `junction $testdir/mozmill/compactheader compactheader`;
-    }
-    else {
-      system "ln", "-sfn", qq[$currentdir/compactheader], qq[$testdir/mozmill/compactheader];
-    }
+  print "$pid\t$ostype\t$hosttype\t$version\t$appbin\t$tests\n";
 
-    # copy drag'n'drop helpers to shared-modules until they are added to thunderbird source
-    my @shared_files = glob("shared-modules/*");
-    foreach my $file (@shared_files) {
-      if (! -e "$testdir/mozmill/shared-modules/$file") {
-        copy("$file","$testdir/mozmill/shared-modules");
-      }
-    }
+  my $testdir = "test-$version";
+  chdir "$testdir/mozmill";
+  #system "pwd";
 
-    chdir "$testdir/mozmill";
-    #system "pwd";
+  my $log;
+  my $python;
 
-    my $log;
-    my $python;
-
-    no warnings;
-    if (int($version) >= 9) {
-    use warnings;
-      `python resources/installmozmill.py ../mozmill-virtualenv`;
-      $python = "$virtualpython";
-    }
-    else {
-      $python = "python"
-    }
+  no warnings;
+  if (int($version) >= 9) {
+  use warnings;
+    `python resources/installmozmill.py ../mozmill-virtualenv`;
+    $python = "$virtualpython";
+  }
+  else {
+    $python = "python"
+  }
 
-    my @compatibility_apps = (
-      "../../ftp//$ostype-$hosttype-$version/lightning.xpi",
-      "../../$dispMUAfile"
-    );
-    my $comp_apps = join(",", @compatibility_apps);
+  my @compatibility_apps = (
+    "../../ftp//$ostype-$hosttype-$version/lightning.xpi",
+    "../../$dispMUAfile"
+  );
+  my $comp_apps = join(",", @compatibility_apps);
 #    print "$python runtest.py --binary=../thunderbird/$appbin -a $xpi -t compactheader 2>&1\n";
-    $log = $log . `$python runtest.py --binary=../thunderbird/$appbin -a $xpi -t compactheader 2>&1`;
-    $log = $log . `$python runtest.py --binary=../thunderbird/$appbin -a $xpi,$comp_apps -t compactheader/test-compactheader-toolbar.js 2>&1`;
-    $log = $log . `$python runtest.py --binary=../thunderbird/$appbin -a $xpi,$comp_apps -t compactheader/test-compactheader-preferences.js 2>&1`;
-
-    chdir "$currentdir";
-    my @timeData = localtime(time);
-    my $datestr = sprintf "%04d%02d%02d%02d%02d", 1900+$timeData[5],
-      1+$timeData[4], $timeData[3], $timeData[2], $timeData[1];
-    open (LOG, ">log-$version-$ostype-$hosttype-$datestr.txt");
-    print LOG "$log";
-    close(LOG);
-
-    print "Test failures:\n";
-    my @logs = split(/\n/, $log);
-    foreach my $line (@logs) {
-      if ($line =~ /(UNEXPECTED|^  )/) {
-        print "$line\n";
-      }
+  $log = $log . `$python runtest.py --binary=../thunderbird/$appbin -a $xpi -t compactheader 2>&1`;
+  $log = $log . `$python runtest.py --binary=../thunderbird/$appbin -a $xpi,$comp_apps -t compactheader/test-compactheader-toolbar.js 2>&1`;
+  $log = $log . `$python runtest.py --binary=../thunderbird/$appbin -a $xpi,$comp_apps -t compactheader/test-compactheader-preferences.js 2>&1`;
+
+  chdir "$currentdir";
+  my @timeData = localtime(time);
+  my $datestr = sprintf "%04d%02d%02d%02d%02d", 1900+$timeData[5],
+    1+$timeData[4], $timeData[3], $timeData[2], $timeData[1];
+  open (LOG, ">log-$version-$ostype-$hosttype-$datestr.txt");
+  print LOG "$log";
+  close(LOG);
+
+  print "Test failures:\n";
+  my @logs = split(/\n/, $log);
+  foreach my $line (@logs) {
+    if ($line =~ /(UNEXPECTED|^  )/) {
+      print "$line\n";
     }
-    print "\n\n";
   }
+  print "\n\n";
 }
 
 close (F);
diff --git a/test/testapps.csv b/test/testapps.csv
index 1c9930e..f729f08 100644
--- a/test/testapps.csv
+++ b/test/testapps.csv
@@ -6,7 +6,7 @@
 "linux","i686","https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-candidate-comm-beta/linux-i686/en-US/","thunderbird-_VER_.tar.bz2","thunderbird-_VER_.tests.zip",".checksums","https://ftp.mozilla.org/pub/mozilla.org/calendar/lightning/releases/1.0b5rc3/linux/lightning.xpi"
 "linux","x86_64","https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-candidate-comm-beta/linux-x86_64/en-US/","thunderbird-_VER_.tar.bz2","thunderbird-_VER_.tests.zip",".checksums","https://ftp.mozilla.org/pub/mozilla.org/calendar/lightning/releases/1.0b5rc3/linux/lightning.xpi"
 
-"msys","i686","https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-comm-aurora/","thunderbird-_VER_.en-US.win32.zip","thunderbird-_VER_.en-US.win32.tests.zip",".en-US.win32.checksums","https://ftp.mozilla.org/pub/mozilla.org/calendar/lightning/nightly/latest-comm-miramar/win32-xpi/lightning.xpi"
+"msys","i686","https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-comm-aurora/","thunderbird-_VER_.en-US.win32.zip","thunderbird-_VER_.en-US.win32.tests.zip",".en-US.win32.checksums","https://ftp.mozilla.org/pub/mozilla.org/calendar/lightning/nightly/latest-comm-aurora/win32-xpi/lightning.xpi"
 "linux","i686""https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-comm-aurora/","thunderbird-_VER_.en-US.linux-i686.tar.bz2","thunderbird-_VER_.en-US.linux-i686.tests.zip",".en-US.linux-i686.checksums","https://ftp.mozilla.org/pub/mozilla.org/calendar/lightning/nightly/latest-comm-miramar/linux-xpi/lightning.xpi"
 "linux","x86_64","https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-comm-aurora/","thunderbird-_VER_.en-US.linux-x86_64.tar.bz2","thunderbird-_VER_.en-US.linux-x86_64.tests.zip",".en-US.linux-x86_64.checksums","https://ftp.mozilla.org/pub/mozilla.org/calendar/lightning/nightly/latest-comm-miramar/linux64-xpi/lightning.xpi"
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/compactheader.git



More information about the Pkg-mozext-commits mailing list