summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFernando J Pando <fernando.pando@stelligent.com>2017-02-27 14:02:11 -0500
committerFranz Pletz <fpletz@fnordicwalking.de>2017-03-07 00:45:37 +0100
commit9f062c2c0b98a8f6e715dacc4b90ca712a868fac (patch)
tree18bcc7bde18dffca91815f2f6ff519a8c8c497f2 /nixos
parentd102115101a91788013f732193340a8e88d0282e (diff)
downloadnixpkgs-9f062c2c0b98a8f6e715dacc4b90ca712a868fac.tar
nixpkgs-9f062c2c0b98a8f6e715dacc4b90ca712a868fac.tar.gz
nixpkgs-9f062c2c0b98a8f6e715dacc4b90ca712a868fac.tar.bz2
nixpkgs-9f062c2c0b98a8f6e715dacc4b90ca712a868fac.tar.lz
nixpkgs-9f062c2c0b98a8f6e715dacc4b90ca712a868fac.tar.xz
nixpkgs-9f062c2c0b98a8f6e715dacc4b90ca712a868fac.tar.zst
nixpkgs-9f062c2c0b98a8f6e715dacc4b90ca712a868fac.zip
buildbot: 0.9.3 -> 0.9.4
- adds jwt
- adds module tests
- master.cfg as path in module
- fix systemd worker config
- builds on darwin
- tested on nixos
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/continuous-integration/buildbot/master.nix18
-rw-r--r--nixos/modules/services/continuous-integration/buildbot/worker.nix5
-rw-r--r--nixos/tests/buildbot.nix46
3 files changed, 53 insertions, 16 deletions
diff --git a/nixos/modules/services/continuous-integration/buildbot/master.nix b/nixos/modules/services/continuous-integration/buildbot/master.nix
index f638cf4bae3..68306109130 100644
--- a/nixos/modules/services/continuous-integration/buildbot/master.nix
+++ b/nixos/modules/services/continuous-integration/buildbot/master.nix
@@ -28,7 +28,7 @@ let
 
     ${cfg.extraConfig}
   ''
-  else pkgs.writeText "master.cfg" cfg.masterCfg;
+  else cfg.masterCfg;
 
 in {
   options = {
@@ -66,13 +66,10 @@ in {
       };
 
       masterCfg = mkOption {
-        type = types.nullOr types.str;
-        description = ''
-          Optionally pass raw master.cfg file as string.
-          Other options in this configuration will be ignored.
-        '';
+        type = types.nullOr types.path;
+        description = "Optionally pass master.cfg path. Other options in this configuration will be ignored.";
         default = null;
-        example = "BuildmasterConfig = c = {}";
+        example = "/etc/nixos/buildbot/master.cfg";
       };
 
       schedulers = mkOption {
@@ -88,7 +85,7 @@ in {
         type = types.listOf types.str;
         description = "List of Builders.";
         default = [
-          "util.BuilderConfig(name='runtests',workernames=['default-worker'],factory=factory)"
+          "util.BuilderConfig(name='runtests',workernames=['example-worker'],factory=factory)"
         ];
       };
 
@@ -183,10 +180,7 @@ in {
       package = mkOption {
         type = types.package;
         default = pkgs.buildbot-ui;
-        description = ''
-          Package to use for buildbot.
-          <literal>buildbot-full</literal> is required in order to use local workers.
-        '';
+        description = "Package to use for buildbot.";
         example = pkgs.buildbot-full;
       };
 
diff --git a/nixos/modules/services/continuous-integration/buildbot/worker.nix b/nixos/modules/services/continuous-integration/buildbot/worker.nix
index 430fd4e53f1..1ad1319d501 100644
--- a/nixos/modules/services/continuous-integration/buildbot/worker.nix
+++ b/nixos/modules/services/continuous-integration/buildbot/worker.nix
@@ -100,14 +100,11 @@ in {
 
     systemd.services.buildbot-worker = {
       description = "Buildbot Worker.";
-      after = [ "network.target" ];
+      after = [ "network.target" "buildbot-master.service" ];
       wantedBy = [ "multi-user.target" ];
-      wants = [ "buildbot-master.service" ];
       path = cfg.packages;
 
       preStart = ''
-        # NOTE: ensure master has time to start in case running on localhost
-        ${pkgs.coreutils}/bin/sleep 4
         ${pkgs.coreutils}/bin/mkdir -vp ${cfg.buildbotDir}
         ${cfg.package}/bin/buildbot-worker create-worker ${cfg.buildbotDir} ${cfg.masterUrl} ${cfg.workerUser} ${cfg.workerPass}
       '';
diff --git a/nixos/tests/buildbot.nix b/nixos/tests/buildbot.nix
new file mode 100644
index 00000000000..13a162e6c6e
--- /dev/null
+++ b/nixos/tests/buildbot.nix
@@ -0,0 +1,46 @@
+# Test ensures buildbot master comes up correctly and workers can connect
+
+import ./make-test.nix ({ pkgs, ... } : {
+  name = "buildbot";
+
+  nodes = {
+    bbmaster = { config, pkgs, nodes, ... }: {
+      services.buildbot-master = {
+        enable = true;
+        factorySteps = [
+          "steps.Git(repourl='git://github.com/buildbot/pyflakes.git', mode='incremental')"
+          "steps.ShellCommand(command=['trial', 'pyflakes'])"
+        ];
+        changeSource = [
+          "changes.GitPoller('git://github.com/buildbot/pyflakes.git', workdir='gitpoller-workdir', branch='master', pollinterval=300)"
+        ];
+      };
+      networking.firewall.allowedTCPPorts = [ 8010 9989 ];
+    };
+
+    bbworker = { config, pkgs, ... }: {
+      services.buildbot-worker = {
+        enable = true;
+        masterUrl = "bbmaster:9989";
+      };
+    };
+  };
+
+  testScript = ''
+
+    $bbmaster->waitForUnit("network.target");
+    $bbworker->waitForUnit("network.target");
+
+    # Additional tests to be added
+    #$bbmaster->waitForUnit("buildbot-master.service");
+    #$bbmaster->waitUntilSucceeds("curl -s --head http://bbmaster:8010") =~ /200 OK/ or die;
+    #$bbworker->waitForUnit("buildbot-worker.service");
+    #$bbworker->waitUntilSucceeds("tail -10 /home/bbworker/worker/twistd.log") =~ /success/ or die;
+
+  '';
+
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ nand0p ];
+  };
+
+})