summary refs log tree commit diff
path: root/nixos/tests/gitlab.nix
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2018-11-02 21:22:51 +0100
committerRobin Gloster <mail@glob.in>2018-11-02 22:40:21 +0100
commitec7cb84bf07ef1064a28b0b4dbb370efacd9e56e (patch)
tree2b3856ec165b2b951798202d06ea6bb51c1f55a9 /nixos/tests/gitlab.nix
parenta4234645fe2445fe503413b159a842dbb280a777 (diff)
downloadnixpkgs-ec7cb84bf07ef1064a28b0b4dbb370efacd9e56e.tar
nixpkgs-ec7cb84bf07ef1064a28b0b4dbb370efacd9e56e.tar.gz
nixpkgs-ec7cb84bf07ef1064a28b0b4dbb370efacd9e56e.tar.bz2
nixpkgs-ec7cb84bf07ef1064a28b0b4dbb370efacd9e56e.tar.lz
nixpkgs-ec7cb84bf07ef1064a28b0b4dbb370efacd9e56e.tar.xz
nixpkgs-ec7cb84bf07ef1064a28b0b4dbb370efacd9e56e.tar.zst
nixpkgs-ec7cb84bf07ef1064a28b0b4dbb370efacd9e56e.zip
gitlab: refactor and fix test
Diffstat (limited to 'nixos/tests/gitlab.nix')
-rw-r--r--nixos/tests/gitlab.nix18
1 files changed, 13 insertions, 5 deletions
diff --git a/nixos/tests/gitlab.nix b/nixos/tests/gitlab.nix
index 3af2cbcd098..53675c375e3 100644
--- a/nixos/tests/gitlab.nix
+++ b/nixos/tests/gitlab.nix
@@ -1,14 +1,18 @@
 # This test runs gitlab and checks if it works
 
-import ./make-test.nix ({ pkgs, ...} : {
+import ./make-test.nix ({ pkgs, lib, ...} : with lib; {
   name = "gitlab";
   meta = with pkgs.stdenv.lib.maintainers; {
-    maintainers = [ domenkozar offline ];
+    maintainers = [ globin ];
   };
 
   nodes = {
     gitlab = { ... }: {
-      virtualisation.memorySize = 768;
+      virtualisation.memorySize = 4096;
+      systemd.services.gitlab.serviceConfig.Restart = mkForce "no";
+      systemd.services.gitlab-workhorse.serviceConfig.Restart = mkForce "no";
+      systemd.services.gitaly.serviceConfig.Restart = mkForce "no";
+      systemd.services.gitlab-sidekiq.serviceConfig.Restart = mkForce "no";
 
       services.nginx = {
         enable = true;
@@ -19,10 +23,10 @@ import ./make-test.nix ({ pkgs, ...} : {
         };
       };
 
-      systemd.services.gitlab.serviceConfig.TimeoutStartSec = "10min";
       services.gitlab = {
         enable = true;
         databasePassword = "dbPassword";
+        initialRootPassword = "notproduction";
         secrets = {
           secret = "secret";
           otp = "otpsecret";
@@ -65,8 +69,12 @@ import ./make-test.nix ({ pkgs, ...} : {
 
   testScript = ''
     $gitlab->start();
+    $gitlab->waitForUnit("gitaly.service");
+    $gitlab->waitForUnit("gitlab-workhorse.service");
     $gitlab->waitForUnit("gitlab.service");
     $gitlab->waitForUnit("gitlab-sidekiq.service");
-    $gitlab->waitUntilSucceeds("curl http://localhost:80/users/sign_in");
+    $gitlab->waitForFile("/var/gitlab/state/tmp/sockets/gitlab.socket");
+    $gitlab->waitUntilSucceeds("curl -sSf http://localhost/users/sign_in");
+    $gitlab->succeed("${pkgs.sudo}/bin/sudo -u gitlab -H gitlab-rake gitlab:check 1>&2")
   '';
 })