[Bps-public-commit] smokingit-worker branch, master, updated. c108c72c53f7a52c5a672b820a97861b1e5e1f72

Alex Vandiver alexmv at bestpractical.com
Thu Nov 14 20:56:34 EST 2013


The branch, master has been updated
       via  c108c72c53f7a52c5a672b820a97861b1e5e1f72 (commit)
       via  150b6960e532d2afc4f9fd6ede406cf43f770714 (commit)
       via  5862a5fab778f55995481b5df59db6f7b0170cdd (commit)
       via  c55c2ebdbf6a596be3ca9759bf4bb8acdab97a6c (commit)
      from  70b792224fb180edf76cc9420fde52c131167b86 (commit)

Summary of changes:
 lib/Smokingit/Worker.pm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit c55c2ebdbf6a596be3ca9759bf4bb8acdab97a6c
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Nov 14 20:46:41 2013 -0500

    Allow environment vars to build on others

diff --git a/lib/Smokingit/Worker.pm b/lib/Smokingit/Worker.pm
index 4fa4d40..47a357c 100644
--- a/lib/Smokingit/Worker.pm
+++ b/lib/Smokingit/Worker.pm
@@ -154,6 +154,7 @@ sub run_tests {
     for my $line (split /\n/, $env) {
         $line =~ s/\s*$//;
         my ($var, $val) = split /\s*[:=\s]\s*/, $line, 2;
+        $val =~ s/$(\w+)/$ENV{$1}/g;
         warn "Setting $var=$val\n";
         $ENV{$var} = $val;
     }

commit 5862a5fab778f55995481b5df59db6f7b0170cdd
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Nov 14 20:54:31 2013 -0500

    Use absolute paths to ensure paths don't creep

diff --git a/lib/Smokingit/Worker.pm b/lib/Smokingit/Worker.pm
index 47a357c..da18eaf 100644
--- a/lib/Smokingit/Worker.pm
+++ b/lib/Smokingit/Worker.pm
@@ -11,6 +11,7 @@ use Coro::AnyEvent;
 use TAP::Harness;
 use Storable qw( nfreeze thaw );
 use YAML;
+use Cwd qw();
 
 use Smokingit::Worker::Clean::TmpFiles;
 use Smokingit::Worker::Clean::Postgres;
@@ -34,7 +35,7 @@ sub new {
     );
     $self->{pubsub} = $pubsub;
     $self->{max_jobs} = $args{max_jobs};
-    $self->{repo_path} = $args{repo_path};
+    $self->{repo_path} = Cwd::realpath($args{repo_path});
     die "No valid repository path set!"
         unless $args{repo_path} and -d $args{repo_path};
 
@@ -123,7 +124,7 @@ sub run_tests {
         system("git", "clean", "-fxdq");
         system("git", "reset", "--hard", "HEAD");
         $_->clean for @cleaners;
-        chdir("..");
+        chdir( $self->repo_path );
         %ENV = %ORIGINAL_ENV;
         return undef;
     };

commit 150b6960e532d2afc4f9fd6ede406cf43f770714
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Nov 14 20:54:52 2013 -0500

    Store repository root in an env var

diff --git a/lib/Smokingit/Worker.pm b/lib/Smokingit/Worker.pm
index da18eaf..8630df5 100644
--- a/lib/Smokingit/Worker.pm
+++ b/lib/Smokingit/Worker.pm
@@ -106,14 +106,16 @@ sub run_tests {
     my $result = { smoke_id => $request->{smoke_id} };
 
     # Clone ourselves a copy if need be
+    $ENV{REPO_ROOT} = $self->repo_path . "/" . $project;
+
     if (-d $project) {
         warn "Updating $project\n";
-        chdir($project);
+        chdir($ENV{REPO_ROOT});
         system("git", "remote", "update");
     } else {
         warn "Cloning $project\n";
         system("git", "clone", "--quiet", $url, $project);
-        chdir($project);
+        chdir($ENV{REPO_ROOT});
     }
 
     # Set up initial state for cleaning purposes

commit c108c72c53f7a52c5a672b820a97861b1e5e1f72
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Nov 14 20:56:08 2013 -0500

    Ensure that failure calls give the eventloop a chance to update

diff --git a/lib/Smokingit/Worker.pm b/lib/Smokingit/Worker.pm
index 8630df5..e7351d5 100644
--- a/lib/Smokingit/Worker.pm
+++ b/lib/Smokingit/Worker.pm
@@ -139,6 +139,7 @@ sub run_tests {
         );
         $cleanup->();
         $args{on_failure}->( $result->{error} );
+        Coro::AnyEvent::poll;
     };
 
     # Check the SHA and check it out

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list